您的位置:首页 > 大数据 > 人工智能

sgu297:Fair-play(水题)

2015-07-26 11:07 465 查看
水题老道理,直接上代码。

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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: