#include <bits/stdc++.h>
int czy1[100010];
int czy2[100010];
int n;
void czysc()
{
bool jez=false;
for(int i=0; i<100010; ++i)
{
if(czy1[i]==n)
{
printf("WYGRANA\n");
jez=true;
}
else
{
if(czy2[i]==n)
{
jez=true;
printf("PRZEGRANA\n");
}
}
czy1[i]=0;
czy2[i]=0;
}
if(jez==false)
printf("REMIS\n");
}
int main()
{
int t,m,a,b;
int ile1, ile2;
char c,d;
scanf("%d", &t);
for(int i=0; i<t; ++i)
{
scanf("%d%d", &n, &m);
ile1=0;
ile2=0;
for(int j=0; j<m; ++j)
{
scanf("%d", &a);
scanf("%c", &c);
scanf("%c", &c);
scanf("%c", &d);
scanf("%d", &b);
if(c=='>')
{
czy1[b]++;
}
else
{
czy2[a]++;
}
}
czysc();
}
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | #include <bits/stdc++.h> int czy1[100010]; int czy2[100010]; int n; void czysc() { bool jez=false; for(int i=0; i<100010; ++i) { if(czy1[i]==n) { printf("WYGRANA\n"); jez=true; } else { if(czy2[i]==n) { jez=true; printf("PRZEGRANA\n"); } } czy1[i]=0; czy2[i]=0; } if(jez==false) printf("REMIS\n"); } int main() { int t,m,a,b; int ile1, ile2; char c,d; scanf("%d", &t); for(int i=0; i<t; ++i) { scanf("%d%d", &n, &m); ile1=0; ile2=0; for(int j=0; j<m; ++j) { scanf("%d", &a); scanf("%c", &c); scanf("%c", &c); scanf("%c", &d); scanf("%d", &b); if(c=='>') { czy1[b]++; } else { czy2[a]++; } } czysc(); } return 0; } |
English