题目传送门

 /*
构造水题:对于0的多个位数的NO,对于位数太大的在后面补0,在9×k的范围内的平均的原则
*/
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std; const int MAXN = 1e3 + ;
const int INF = 0x3f3f3f3f;
int a[MAXN]; int main(void) //Codeforces Round #206 (Div. 2) A. Vasya and Digital Root
{
//freopen ("A.in", "r", stdin);
int k, d;
while (scanf ("%d%d", &k, &d) == )
{
if (d == && k > ) {puts ("No solution"); continue;}
if (k >= d)
{
for (int i=; i<=d; ++i) putchar ('');
for (int i=; i<=k-d; ++i) putchar ('');
puts ("");
}
else
{
if ( * k < d) {puts ("No solution"); continue;}
for (int i=; i<=k; ++i) a[i] = d / k;
int res = d % k;
for (int i=; i<=res; ++i) a[i]++;
for (int i=; i<=k; ++i) printf ("%d", a[i]);
puts ("");
} } return ;
}

构造水题 Codeforces Round #206 (Div. 2) A. Vasya and Digital Root的更多相关文章

  1. Codeforces Round #206 (Div. 2) A. Vasya and Digital Root

    #include <iostream> using namespace std; int main(){ int k,d; cin >> k >>d; ) { k ...

  2. 水题 Codeforces Round #302 (Div. 2) A Set of Strings

    题目传送门 /* 题意:一个字符串分割成k段,每段开头字母不相同 水题:记录每个字母出现的次数,每一次分割把首字母的次数降为0,最后一段直接全部输出 */ #include <cstdio> ...

  3. 水题 Codeforces Round #299 (Div. 2) A. Tavas and Nafas

    题目传送门 /* 很简单的水题,晚上累了,刷刷水题开心一下:) */ #include <bits/stdc++.h> using namespace std; ][] = {" ...

  4. 水题 Codeforces Round #304 (Div. 2) A. Soldier and Bananas

    题目传送门 /* 水题:ans = (1+2+3+...+n) * k - n,开long long */ #include <cstdio> #include <algorithm ...

  5. 水题 Codeforces Round #303 (Div. 2) A. Toy Cars

    题目传送门 /* 题意:5种情况对应对应第i或j辆车翻了没 水题:其实就看对角线的上半边就可以了,vis判断,可惜WA了一次 3: if both cars turned over during th ...

  6. 水题 Codeforces Round #286 (Div. 2) A Mr. Kitayuta's Gift

    题目传送门 /* 水题:vector容器实现插入操作,暴力进行判断是否为回文串 */ #include <cstdio> #include <iostream> #includ ...

  7. 水题 Codeforces Round #306 (Div. 2) A. Two Substrings

    题目传送门 /* 水题:遍历一边先找AB,再BA,再遍历一边先找BA,再AB,两种情况满足一种就YES */ #include <cstdio> #include <iostream ...

  8. 水题 Codeforces Round #308 (Div. 2) A. Vanya and Table

    题目传送门 /* 水题:读懂题目就能做 */ #include <cstdio> #include <iostream> #include <algorithm> ...

  9. 水题 Codeforces Round #307 (Div. 2) A. GukiZ and Contest

    题目传送门 /* 水题:开个结构体,rk记录排名,相同的值有相同的排名 */ #include <cstdio> #include <cstring> #include < ...

随机推荐

  1. 【nginx】【转】Nginx核心进程模型

    一.Nginx整体架构 正常执行中的nginx会有多个进程,最基本的有master process(监控进程,也叫做主进程)和woker process(工作进程),还可能有cache相关进程.   ...

  2. MySQL基础笔记(五) 视图

    一.什么是视图 视图是一个虚拟表.也就是说,视图在外观和行为上都类似于表,但它不需要实际的物理存储,只保存了视图定义(查询语句). 视图由select查询所定义 -- 当创建一个视图时,实际上是在数据 ...

  3. 怎样更好的设计你的REST API之基于REST架构的Web Service设计及REST框架实现

    一.REST 含状态传输(英文:Representational State Transfer,简称REST)是Roy Fielding博士在2000年他的博士论文中提出来的一种软件架构风格. 眼下在 ...

  4. Jenkins系列之-—03 修改Jenkins用户的密码

    一.Jenkins修改用户密码 Jenkins用户的数据存放在JENKINS_HOME/users目录. 1. 打开忘记密码的用户文件夹,里面就一个文件config.xml.打开并找到<pass ...

  5. AnkhSVN介绍

    AnkhSVN介绍 Posted on 2012-11-15 23:24 ArRan 阅读(3120) 评论(1) 编辑 收藏 AnkhSVN是一款在VS中管理Subversion的插件,您可以在VS ...

  6. sqlserver中All、Any和Some用法与区别

    转自:http://blog.csdn.net/gyc1105/article/details/8063624 SQLServer中有三个关键字可以修改比较运算符:All.Any和Some,其中Som ...

  7. 【PLSQL Developer】PLSQL Developer SQL Editor 乱码问题

    [问题]我们常常在PLSQL Developer的SQL窗体编写各种语句.当须要保存这些语句时,能够另存为文本文件,也能够复制后粘贴到Word文件里.放在Word文件里的优点是语句保留原来的格式,能够 ...

  8. 菜鸟Sublime日记

            一.进行系统安装:www.sublimetext.com/3   选择相应的操作系统,你会发现安装速度惊人的快. 二.安装完成以后,先安装两个基本的插件package control ...

  9. oracle 10g的备份和还原

    采用 expdp备份,impdp还原. 注意这二者不等同于exp和imp.oracle 10g以前,可以采用exp.imp,10g及以后,expdp + impdp矣.据说10g里面,如果采用exp, ...

  10. myecplise、ecplise项目空间优化

    1.代码自动提示补全 Window->preferences->Java->Editor->Content Assist 再右下角Auto activation trigger ...