好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

CodeforcesRound#281(Div.2)解题报告A.B.C.D._html/css_WE

A - Vasya and Football

纯模拟。。比较坑的是会有不符合足球常识的地方。。

代码如下:

#include  #include  #include  #include  #include  #include  #include  #include  #include  #include  #include using namespace std;#define LL __int64const int INF=0x3f3f3f3f;struct node{        int num, time, f;        char ah;}fei[100];int cmp(node x, node y){        return x.time =2){                        if(fei[i].ah=='h') printf("%s ",s1);                        else printf("%s ",s2);                        printf("%d %d\n",fei[i].num,fei[i].time);                }        }        return 0;} 

B - Vasya and Wrestling

水题。。先比较和然后再根据题意比较字典序即可。实在没啥好说的。。

代码如下:

#include  #include  #include  #include  #include  #include  #include  #include  #include  #include  #include using namespace std;#define LL __int64const int INF=0x3f3f3f3f;LL a[210000], b[210000];int main(){        LL cnt1=0, cnt2=0, n, x, s1=0, s2=0, t;        int i;        scanf("%I64d",&n);        while(n--){                scanf("%I64d",&x);                if(x>0){                        a[cnt1++]=x;                        s1+=x;                }                else{                        b[cnt2++]=-x;                        s2-=x;                }                if(n==0) t=x>0?1:2;        }        if(s1>s2) printf("first\n");        else if(s1 b[i]){                                flag=1;                                break;                        }                        else if(a[i] cnt2) puts("first");                else if(cnt1 
C - Vasya and Basketball

也是一水题。。不过我直接跪了。。各种细节手残。。居然错了11次。。。。。中间还交到D题去了一次。。。

先把各种出现过的数存起来,排序,然后分别二分判断两人有多少个二分,有多少三分的,找最大值即可。

代码如下:

#include  #include  #include  #include  #include  #include  #include  #include  #include  #include  #include using namespace std;#define LL __int64const int INF=0x3f3f3f3f;int a[210000], b[210000], n, m, c[420000], f[420000];int bin_search(int d[], int x, int high){        int low=1, mid, ans=0;        while(low >1;                if(d[mid] 


D - Vasya and Chess

猜想题、、所以我是猜的、、证明不会。。

代码如下:

#include  #include  #include  #include  #include  #include  #include  #include  #include  #include  #include using namespace std;#define LL __int64const int INF=0x3f3f3f3f;int main(){        int n;        scanf("%d",&n);        if(n%2==0)  printf("white\n1 2\n");        else                printf("black\n");        return 0;} 

查看更多关于CodeforcesRound#281(Div.2)解题报告A.B.C.D._html/css_WE的详细内容...

  阅读:31次