Codeforces 456B Fedya and Maths(数学)
来源:互联网 发布:c语言getchar函数用法 编辑:程序博客网 时间:2024/05/21 17:57
题目链接:Codeforces 456B Fedya and Maths
题目大意:给定一个数n,求题目给定公式的值。
解题思路:n为4的倍数时答案为4,否则为0,取模质数时的性质,以前做过相同的题目。
#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int maxn = 1e5+5;char s[maxn];int main () { scanf("%s", s); int len = strlen(s); int ans = 0; for (int i = 0; i < len; i++) ans = (ans * 10 + s[i] - '0') % 4; printf("%d\n", ans == 0 ? 4 : 0); return 0;}
0 0
- Codeforces 456B Fedya and Maths(数学)
- Codeforces 456B Fedya and Maths
- Codeforces #260 (Div. 2) B. Fedya and Maths(数学:水题)
- B. Fedya and Maths
- cf 456B - 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 #260 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
- Codeforces Round #260 (Div. 2)B. Fedya and Maths
- codeforces 456B. Fedya and Maths(大数取模/大数的幂)
- CF 456B(Fedya and Maths-找循环节)
- codeforce 2014808 B. Fedya and Maths
- CF 260 B. Fedya and Maths
- 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种实现方法
- [水]ZOJ1457
- 策略模式
- cf 456 c
- 【机房重构】周结账单