sgu297:Fair-play(水题)
2015-07-26 11:07
465 查看
水题老道理,直接上代码。
AC code:
AC code:
[code]#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define clr(a, b) memset(a, b, sizeof a) #define rep(i, a, b) for(int i = (a); i <= (b); ++i) #define per(i, a, b) for(int i = (a); i >= (b); --i) typedef long long LL; typedef double DB; typedef long double LD; using namespace std; void open_init() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ios::sync_with_stdio(0); } void close_file() { #ifndef ONLINE_JUDGE fclose(stdin); fclose(stdout); #endif } int n, m, s; int main() { open_init(); scanf("%d%d", &n, &m); rep(i, 1, m) { int x; scanf("%d", &x); s += x; } printf("%d", s%n); close_file(); return 0; }
相关文章推荐
- Scala入门到精通——第十一节 Trait进阶
- MyBaits一对一的查询方法
- 【ID搜索】uva529Addition Chains
- linux下C获取文件的大小http://blog.csdn.net/gdujian0119/article/details/6363574
- linux下如何用c语言调用shell命令http://blog.csdn.net/hzhsan/article/details/7989921
- Linux检测TCP连接断开的一种简单实现方法http://blog.csdn.net/wtewrw/article/details/6547380
- LoadRunner Controller阶段,脚本运行正常Passed Transactions 和Failed Transactions Errors 都没有数据显示?
- HDU 2674 N!Again【数学&&同余定理】
- 【Leetcode】 Factorial Trailing Zeroes #172
- rails总结
- rails总结
- Hive Failed with exception Unable to rename
- 2015 Multi-University Training Contest 2 1002
- 2009 Multi-University Training Contest 10 - Host by NIT
- 为什么wait(),notify()和notifyAll()必须在同步块或同步方法中调
- 杭电ACM HDU 2674 N!Again
- UVa1437&LA4394 StringPainter
- Scala入门到精通——第十节 Scala类层次结构、Traits初步
- Container With Most Water (头尾指针的妙用)
- synchronized , wait() , notify() and notifyAll()