Codeforce 584A - Olesya and Rodion
Olesya loves numbers consisting of n digits, and Rodion only likes numbers that are divisible by t. Find some number that satisfies both of them.
Your task is: given the n and t print an integer strictly larger than zero consisting of n digits that is divisible by t. If such number doesn't exist, print - 1.
The single line contains two numbers, n and t (1 ≤ n ≤ 100, 2 ≤ t ≤ 10) — the length of the number and the number it should be divisible by.
Print one such positive number without leading zeroes, — the answer to the problem, or - 1, if such number doesn't exist. If there are multiple possible answers, you are allowed to print any of them.
3 2
712
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <sstream>
using namespace std;
const int maxn = 1e9+;
#define N 10005
int main()
{
int n,t,i;
scanf("%d %d", &n, &t);
if(n==&&t==){
printf("-1\n");
}
else{
if(t==){
t=;
}
printf("%d",t);
for(i=;i<n-; i++) {
printf("");
}
printf("\n");
}
return ;
}
Codeforce 584A - Olesya and Rodion的更多相关文章
- Codeforces Round #324 (Div. 2) A. Olesya and Rodion 水题
A. Olesya and Rodion Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/584/p ...
- Olesya and Rodion (思维)
Olesya loves numbers consisting of n digits, and Rodion only likes numbers that are divisible by t. ...
- Codeforces Round #324 (Div. 2) Olesya and Rodion 构造
原题链接:http://codeforces.com/contest/584/problem/A 题意: 给你n和t,让你构造一个长度为n的数,并且被t整除 题解: 方法很多,可以乱构造.....不过 ...
- Codeforces Round #324 (Div. 2)解题报告
---恢复内容开始--- Codeforces Round #324 (Div. 2) Problem A 题目大意:给二个数n.t,求一个n位数能够被t整除,存在多组解时输出任意一组,不存在时输出“ ...
- Codeforces 584 - A/B/C/D/E - (Done)
链接:https://codeforces.com/contest/584 A - Olesya and Rodion - [水] 题解:注意到 $t$ 的范围是 $[2,10]$,对于位数小于 $2 ...
- Codeforces Round #324 (Div. 2) A
A. Olesya and Rodion time limit per test 1 second memory limit per test 256 megabytes input standard ...
- Codeforces Round #324 (Div. 2)
CF的rating设置改了..人太多了,决定开小号打,果然是明智的选择! 水 A - Olesya and Rodion #include <bits/stdc++.h> using na ...
- Codeforce - Street Lamps
Bahosain is walking in a street of N blocks. Each block is either empty or has one lamp. If there is ...
- Codeforce Round #216 Div2
e,还是写一下这次的codeforce吧...庆祝这个月的开始,看自己有能,b到什么样! cf的第二题,脑抽的交了错两次后过了pretest然后system的挂了..脑子里还有自己要挂的感觉,果然回头 ...
随机推荐
- Matplotlib绘制漫威英雄战力图,带你飞起来!
目录 前言 期望功能 代码实现 一.导入matplotlib依赖包 二.支持显示中文 三.使用ggplot主题 四.根据能力项等分圆 五.生成n个子图 六.获取支持的颜色 六.绘制所有子图 更多示例 ...
- 聊聊GIS中的坐标系|再版 详细定义、计算及高程系统
本篇讲坐标系统的详细定义,有关坐标系的变换公式,以及简单说说高程坐标系统. 本文约6000字,阅读时间建议45分钟.硬内容比较多,如有疏漏错误请指出,建议有兴趣的朋友进一步阅读. 作者:博客园/B站/ ...
- Android布局管理器-使用FrameLayout帧布局管理器显示层叠的正方形以及前景照片
场景 Android布局管理器-使用LinearLayout实现简单的登录窗口布局: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details ...
- Linux 用户、用户组管理
Linux系统是一个多用户多任务的分时操作系统,每个用户都有用户名(唯一).口令,用户名唯一标识该用户账号. 用户管理主要涉及到用户添加.修改和删除. 切换用户 su 用户名 su即swit ...
- 转载:字符编码简介 ASCII UTF-8 ISO8859-1
字符编码简介 ASCII UTF-8 ISO8859-1 博客分类: 电脑综合知识 XP数据结构Windows 计算机中的一切都是以数字来表示的,字符同样如此.字符编码就是将字符集编码成为数字序列, ...
- c# 读写SerialPort
SerialDataReceivedEventHandler无反映不要忘记这2属性赋值. serialPort1.DtrEnable = true; serialPort1.RtsEnable = ...
- 《手把手教你构建自己的 Linux 系统》学习笔记(7)
目录 tee 命令的缺陷是什么?如何解决这个缺陷? /etc/ld.so.conf 文件的作用是什么? 动态链接和静态链接有什么不同? 动态编译 静态编译 共享库为什么会有版本?共享库的版本升级原理是 ...
- java 上传文件到七牛云中
import com.alibaba.fastjson.JSONObject;import com.qiniu.common.QiniuException;import com.qiniu.commo ...
- Asp.ner Core-Blazor随手记
后续继续补充内容.... 1.安装.Net Core3.0 SDK及以上版本都有待Blazor 2.如果想在.razor页面直接使用C#代码,相当于html里面嵌入了C#代码,可以在命令行里面输入下面 ...
- Python小白
.IDLE软件为内建于CPython的集成开发环境(IDE),包括编辑器,编译或解释器,调试器 .py(后缀保存) 2.行一,单行注释 多行,””” ‘’’ 之后,内建 ...