cf 456B - Fedya and Maths
来源:互联网 发布:c语言getchar函数用法 编辑:程序博客网 时间:2024/05/21 22:48
第一眼看就觉得是个规律题。。然后暴力跑下 发现 4的倍数输出4 其他全为0
#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>using namespace std;int const MAXN = 1000000;char str[MAXN];int main(){ scanf("%s",str); int s = 0; int l = strlen(str); for(int i = 0;i < l;i++){ s = (s * 10 + str[i] -'0') % 4; } //cout<<s<<endl; if(s)printf("0\n"); else printf("4\n"); return 0;}
0 0
- cf 456B - Fedya and Maths
- CF 456B(Fedya and Maths-找循环节)
- CF 260 B. Fedya and Maths
- B. Fedya and Maths
- Codeforces 456B Fedya and Maths
- Codeforces 456B Fedya and Maths(数学)
- codeforce 2014808 B. Fedya and Maths
- codeforces 456B. Fedya and Maths(大数取模/大数的幂)
- Codeforces Round #260 (Div. 2) B. Fedya and Maths
- Codeforces Round #260 (Div. 2)B. Fedya and Maths
- codeforces #260 B. Fedya and Maths(水)
- Codeforces Round #260 (Div. 2) B Fedya and Maths
- Codeforces Round #260 (Div. 2) B. Fedya and Maths
- Codeforces #260 (Div. 2) B. Fedya and Maths(数学:水题)
- Codeforces Round #260 (Div. 2)B. Fedya and Maths
- Codeforces Round #260 (Div. 2) B. Fedya and Maths
- Codeforces Round #260 (Div. 2)B. Fedya and Maths
- Codeforces Round #260 (Div. 2) B. Fedya and Maths【超数范围的取模】
- Android蓝牙程序开发
- 第一个项目(三)
- MyBatis3整合Spring3、SpringMVC3
- 在线阅读安卓(Android)系统源码
- Qt Webkit中浏览器插件设计实现
- cf 456B - Fedya and Maths
- cocos2d-x for wp之EaseActions——运动加速效果
- Codeforces Round #260 (Div. 2) A ~ C
- SVPullToRefresh 下拉刷新导航栏位置错误
- Codeforces 456B Fedya and Maths(数学)
- eclipse 不同版本,插件相关
- Linux下查看文件内容
- Java学习笔记(十一)日期日历类和随机类等
- Python单例模式的4种实现方法