刷題記錄
A | CodeForces 50A | Domino piling |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n=0;
int m=0;
scanf("%d%d",&n,&m);
printf("%d",n*m/2);
return 0;
}
B | CodeForces 1030A | In Search of an Easy Problem |
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
int n=0;
int counter=0;
int ans;
int easy=0;
int hard=0;
cin>>n;
while(counter<n)
{
cin>>ans;
counter++;
if(ans==1)
{
hard=hard+1;
}
else
{
easy=easy+1;
}
}
if(hard>0)
{
printf("HARD");
}
else
{
printf("EASY");
}
return 0;
}
C | CodeForces 231A | Team |
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int n ;
int counter = 0;
int p;
int v;
int t;
int yes = 0;
cin >> n;
while (counter < n)
{
cin >> p >> v >> t;
counter++;
if (p + v + t >= 2)
{
yes++;
}
}
cout<<yes;
return 0;
}
D | CodeForces 703A | Mishka and Game |
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int rounds = 0;
int m, c;
int mwin = 0;
int cwin = 0;
cin >> rounds;
for (int i=0; i < rounds; i++)
{
cin >> m >> c;
if (m > c)
{
mwin++;
}
else if (c > m)
{
cwin++;
}
}
if (mwin > cwin)
{
printf("Mishka");
}
else if (cwin > mwin)
{
printf("Chris");
}
else
{
printf("Friendship is magic!^^");
}
return 0;
}