A. Olesya and Rodion
来源:互联网 发布:康美包员工 知乎 编辑:程序博客网 时间:2024/06/06 04:21
解题说明:此题要求一个能被t整除的n位数,可以采用构造的方法,最容易想到的数字是以t为开始,后面全部为0. 当然,需要排除位数为1但t=10的情况。
#include<stdio.h>#include <string.h>#include<iostream>#include<algorithm>using namespace std;int main(){ int n, t, i; scanf("%d %d", &n, &t); if(n==1 && t==10) {printf("-1\n");}else{if(t==10) {t=1;}printf("%d", t);for(i=0; i<n-1; i++) {printf("0");}printf("\n"); } return 0;}
0 0
- A. Olesya and Rodion
- cf#324-A. Olesya and Rodion-水题
- Codeforces Round #324 A Olesya and Rodion
- Codeforces 584A Olesya and Rodion 【构造】
- Codeforces Olesya and Rodion
- cf#324 Div.2 Problem A Olesya and Rodion
- Codeforces Round #324 (Div. 2) A. Olesya and Rodion
- Codeforces Round #324 (Div. 2) 584A. Olesya and Rodion
- Codeforces Round #324 (Div. 2)A. Olesya and Rodion
- Codeforces Round #324 (Div. 2) A. Olesya and Rodion
- Code Forces 584 A. Olesya and Rodion(水~)
- Codeforces--584A--Olesya and Rodion(水题)
- CodeForces - 584A Olesya and Rodion (模拟)水
- codeforces——584A——Olesya and Rodion
- Olesya and Rodion(模拟)
- Codeforces 584 A. Olesya and Rodion(Codeforces Round #324 (Div. 2))
- Codeforces 584 A. Olesya and Rodion 数论+找规律(构造)
- Codeforces Round #324 (Div. 2) A. Olesya and Rodion 构造数字 思维题
- Vmware中的Linux与主机系统Windows交互文件的方法
- hibernate 有三种查询方式
- 解决UnicodeEncodeError: 'ascii' codec can't encode characters in position问题
- Fast-Forward Git Merge
- 1670: [Usaco2006 Oct]Building the Moat护城河的挖掘
- A. Olesya and Rodion
- java - JDBC连接数据库参数
- BestCoder Round #57 (div.2) HDU5480 Conturbatio 前缀和
- 机器学习入门
- C++11 之for 新解
- VMware DaaS Free Trial
- BZOJ 1513 [POI2006]Tet-Tetris 3D 二维线段树
- 实现动态输入自动匹配输入的内容的 a a
- C语言学习-数据类型本质(表示一个内存格子的长度和解析方法)