码迷,mamicode.com
首页 > 其他好文 > 详细

Codeforces Round #246 (Div. 2)

时间:2014-05-18 10:53:23      阅读:262      评论:0      收藏:0      [点我收藏+]

标签:style   blog   class   code   c   tar   

A、Choosing Teams

水题

#include <cstdio>
#include <cstring>
using namespace std;

int main()
{
    int n, k, ans, i, x;
    scanf("%d%d",&n,&k);
    ans = 0;
    for(i=0; i<n; ++i)
    {
        scanf("%d",&x);
        if(5-x >= k) ans++;
    }
    ans /= 3;
    printf("%d\n", ans);
    return 0;
}

B、Football Kit

水题

#include <cstdio>
#include <cstring>
#include <set>
using namespace std;

const int maxn = 100000 + 100;
int x[maxn], y[maxn], tx[maxn];
int main()
{
    int  n, i, j;
    scanf("%d",&n);
    for(i=0; i<n; ++i)
    {
        scanf("%d%d",&x[i], &y[i]);
        tx[ x[i]] ++;
    }
    for(i=0; i<n; ++i)
        printf("%d %d\n", n-1 + tx[ y[i] ], n-1 - tx[ y[i] ]);
    return 0;
}

C、Prime Swaps


D、Prefixes and Suffixes


E、Square Tiling


Codeforces Round #246 (Div. 2),布布扣,bubuko.com

Codeforces Round #246 (Div. 2)

标签:style   blog   class   code   c   tar   

原文地址:http://blog.csdn.net/yew1eb/article/details/25991183

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!