题目传送门

 /*
构造水题:对于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. HDOJ 5416 CRB and Tree DFS

    CRB and Tree Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Tot ...

  2. Semaphore使用

    Semaphore使用

  3. How to Uninstall Internet Explorer 11 for Windows 7

    Internet Explorer 11 is the newest version of Microsoft's web browser, but not everyone is a fan. If ...

  4. vue-cli3取掉eslint格式提示报错

    把package.json文件中关于eslint那个直接去掉. "@vue/cli-plugin-eslint": "^3.7.0",

  5. 使用literal语法格式化字符串

    支持arm64之后,格式化字符串的时候会遇到一些问题,主要与NSInteger的定义有关: #if __LP64__ || (TARGET_OS_EMBEDDED && !TARGET ...

  6. soapUI系列之—-04 问题解决 获取接口返回报文response报错

    1. SoapUI+Groovy中"org.apache.xmlbeans.XmlException: error: Unexpected element: CDATA" 通过So ...

  7. 【教程】怎样申请Chrome应用商店(Web Store)开发人员

    首先你须要一张信用卡,假设你没有的话.能够借用父母或他人的(多见于学生党) 假设你有信用卡.你还得看看信用卡正面是否有注明"VISA"."MasterCard" ...

  8. Cocos2d-x 3.2 Lua演示样例CurrentLanguageTest(当前语言环境)

    Cocos2d-x 3.2 Lua演示样例CurrentLanguageTest(当前语言环境) 转载请注明:IT_xiao小巫 本篇博客介绍Cocos2d-x 3.2给我们提供的一个样例.获取当前程 ...

  9. 错误 1 无法将程序集“NBear.Data.dll”复制到文件“D:\newbpm\bpm\SureBpm\Bin\NBear.Data.dll”。无法将“D:\newbpm\bpm\SureSoft.WebServiceBaseLib\bin\Debug\NBear.Data.dll”添加到网站。 无法添加文件“Bin\NBear.Data.dll”。 拒绝访问。 D:\..

    错误 1 无法将程序集“NBear.Data.dll”复制到文件“D:\newbpm\bpm\SureBpm\Bin\NBear.Data.dll”.无法将“D:\newbpm\bpm\SureSof ...

  10. SpringMVC_架构 --跟海涛学SpringMVC(学习笔记)

    重点: 1.工作流程及实现原理 2.配置及使用方法 3.共同函数 前言 1.2.模型: 1.2.1.此处模型使用JavaBean,可能造成JavaBean组件类很庞大,一般现在项目都是采用三层架构,而 ...