Rumah >hujung hadapan web >html tutorial >Codeforces Round #281 (Div. 2) 解题报告 A.B.C.D._html/css_WEB-ITnose

Codeforces Round #281 (Div. 2) 解题报告 A.B.C.D._html/css_WEB-ITnose

WBOY
WBOYasal
2016-06-24 11:52:531072semak imbas

A - Vasya and Football

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

代码如下:

#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <stdlib.h>#include <math.h>#include <ctype.h>#include <queue>#include <map>#include <set>#include <algorithm>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<y.time foul c if return main char s1 s2 c1 c2 int n i j t cnt="0," num flag scanf for fei break sort>=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;}</y.time></algorithm></set></map></queue></ctype.h></math.h></stdlib.h></cstring></string></cstdio></iostream>

B - Vasya and Wrestling

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

代码如下:

#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <stdlib.h>#include <math.h>#include <ctype.h>#include <queue>#include <map>#include <set>#include <algorithm>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<s2 printf else int flag="0;" for if>b[i]){                                flag=1;                                break;                        }                        else if(a[i]<b flag="2;" break if puts else>cnt2) puts("first");                else if(cnt1<cnt2 puts else if return>C - Vasya and Basketball  <p></p>  <p>也是一水题。。不过我直接跪了。。各种细节手残。。居然错了11次。。。。。中间还交到D题去了一次。。。</p>  <p>先把各种出现过的数存起来,排序,然后分别二分判断两人有多少个二分,有多少三分的,找最大值即可。</p>  <p>代码如下:</p>  <p></p>  <pre name="code" class="sycode">#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <stdlib.h>#include <math.h>#include <ctype.h>#include <queue>#include <map>#include <set>#include <algorithm>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]  <br>  <br> D - Vasya and Chess  <br>  <p></p>  <p>猜想题、、所以我是猜的、、证明不会。。</p>  <p>代码如下:<br> </p>  <pre name="code" class="sycode">#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <stdlib.h>#include <math.h>#include <ctype.h>#include <queue>#include <map>#include <set>#include <algorithm>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;}</algorithm></set></map></queue></ctype.h></math.h></stdlib.h></cstring></string></cstdio></iostream>


Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn