bzoj2296: 【POJ Challenge】随机种子(思维题/水题)
2024-08-24 02:59:52
有点类似CF某场div2T1...
前面接上1234567890000000,后面加上x+(1234567890000000%x)就可以保证是x的倍数了
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<algorithm>
#define ll long long
using namespace std;
const int maxn=,inf=1e9;
int T,x;
void read(int &k)
{
int f=;k=;char c=getchar();
while(c<''||c>'')c=='-'&&(f=-),c=getchar();
while(c<=''&&c>='')k=k*+c-'',c=getchar();
k*=f;
}
int main()
{
read(T);
while(T--)
{
read(x);
if(x)printf("1234567890%06lld\n",1ll*x-(1234567890000000ll%x));
else printf("-1\n");
}
return ;
}
最新文章
- hoj 2662 经典状压dp // MyFirst 状压dp
- Daily Build
- linux库之pam
- eclipse 报错汇总
- css+javascript 写的HTML5 微信端输入支付密码键盘
- [汇编语言]-第九章 jcxz,loop指令,转移位移的意义
- tracker-store and tracker-miner-fs eating up my CPU on every startup
- Struts2 单文件上传
- struts2的初步认识!
- hdu1114小猪抢劫银行
- iOS开发从申请账号到上线APP Store步骤
- 从源码安装go 1.2.2
- Tensorflow会话Session
- July 04th. 2018, Week 27th. Wednesday
- 在表单提交之前做校验-利用jQuery的submit方法
- 仿照wtform自定义Form组件
- 使用Go语言+Protobuf协议完成一个多人聊天室
- less的写法 calc以及变量
- 第二十四天- 模块导入 import from xxx import xxx
- HDU.1847 Good Luck in CET-4 Everybody! ( 博弈论 SG分析)
热门文章
- selenium自动化之处理浏览器警告弹窗
- HTML从入门到放弃
- CMDBuild2.4.3安装配置
- 选题博客:北航iCourse课程信息平台
- [C++] Solve ";No source available for main()"; error when debugging on Eclipse
- rest_framework之版本控制
- xpath获取同级元素
- ffmpe安装
- “Hello World!”团队第五周第一次会议
- Thunder团队第七周 - Scrum会议5