online_judge_1125
来源:互联网 发布:什么软件可以制定计划 编辑:程序博客网 时间:2024/06/04 00:07
#include <iostream>#include <string>#include <cstring>using namespace std;const int E = 100000000;int main(){ string str; int a,b,c,d; int len,i,t; bool mark[10]; while(cin>>str) { if(str == "-1") break; a = b = c = d = 0; len = str.size(); if(len>24) { for(i=0; i<len-24; ++i) { a = a*10 + str[i] - '0'; } } if(len>16) { i = max(0, len-24); for(; i<len-16; ++i) { b = b*10 + str[i] - '0'; } } if(len>8) { i = max(0, len-16); for(; i<len-8; ++i) { c = c*10 + str[i] - '0'; } } i = max(0, len-8); for(; i<len; ++i) { d = d*10 + str[i] - '0'; } memset(mark, 0, sizeof(mark)); for(i=9; i>1; --i) { if(mark[i]) continue; t = a%i; t = (b+t*E)%i; t = (c+t*E)%i; t = (d+t*E)%i; if(t == 0) { mark[i] = true; if(i==9 || i==6) mark[3] = true; else if(i==8) { mark[2] = true; mark[4] = true; } else if(i==4) mark[2] = true; } } t = 0; for(i=2; i<10; ++i) { if(mark[i]) { if(t==0) { cout<<i; t++; } else { cout<<" "<<i; t++; } } } if(t == 0) cout<<"none"; cout<<endl; } return 0;}
0 0
- online_judge_1125
- 跟vczh看实例学编译原理——一:Tinymoe的设计哲学
- 【GDKOI2010】圈地计划(网络流)
- 模糊检测BlurDetection using wavelet transform
- 跟vczh看实例学编译原理——二:实现Tinymoe的词法分析
- converview打两个tag
- online_judge_1125
- matlab脚本文件和函数文件
- Drools6.3.0部署(MyEclipse安装与tomcat部署)
- C语言函数不能返回局部变量的地址
- 设计模式学习— 观察者模式
- Java垃圾回收机制
- 红帽redis安装和介绍
- 跟vczh看实例学编译原理——三:Tinymoe与无歧义语法分析
- Mysql优化(一)—Sql语句