#include<stdio.h>
#include<string.h>
int max(int a,int b)
{
if(a>b)
return a;
else
return b;
}
int main()
{
char a[10005],b[10005],c[20005],d[20005];
int j=0,k=0;
scanf("%s",a);
getchar();
scanf("%s",b);
for (int i = 1; i < strlen(a); i++)
{
if ((a[i]-'0') % 2 == (a[i-1]-'0') % 2)
{
c[j]=max((a[i]-'0'), (a[i-1]-'0'))+48;
j++;
}
}
for (int i = 1; i < strlen(b); i++)
{
if ((b[i]-'0') % 2 == (b[i-1]-'0') % 2)
{
d[k]=max((b[i]-'0'), (b[i-1]-'0'))+48;
k++;
}
}
if(strcmp(c,d)==0)
printf("%s",c);
else
printf("%s\n%s",c,d);
return 0;
}
#include<stdio.h>
int c[100005],d[100005];
int main()
{
int n,m,q,s1=0,s2=0;
scanf("%d %d %d",&n,&m,&q);
while(q--)
{
int t,k;
scanf("%d %d",&t,&k);
if(t==0)
{
c[k]++;
}
else
{
d[k]++;
}
}
for(int i=1;i<=n;i++)
{
if(c[i]>0)
s1++;
}
for(int i=1;i<=m;i++)
{
if(d[i]>0)
s2++;
}
printf("%d",n*m-s1*m-s2*n+s1*s2);
return 0;
}
#include<iostream>
#include<algorithm>
using namespace std;
typedef struct List {
int score;
int PATscore;
int flag;
};
List list[100000];
bool cmp(List l1, List l2) {
return l1.score < l2.score;
}
int main() {
int count = 0, percount = 0;
int n, k, s;
cin >> n >> k >> s;
int one, two;
for (int i = 0; i < n; i++) {
cin >> one >> two;
list[i].score = one;
list[i].PATscore = two;
if (one < 175) {
list[i].flag = 1;
}
else {
list[i].flag = 0;
}
}
sort(list,list+n,cmp);
int array[300];
while (k--)
{
percount = 0;
fill(array, array + 300, 0);
for (int i = 0; i < n; i++)
{
if (list[i].flag == 0)
{
if (array[list[i].score] == 0)
{
array[list[i].score] = 1;
list[i].flag = 1;
percount++;
}
else
{
if (list[i].PATscore >= 90)
{
list[i].flag = 1;
percount++;
}
}
}
}
if (percount == 0)
{
break;
}
else
{
count += percount;
}
}
cout << count;
return 0;
}
#include<stdio.h>
int main()
{
printf("Good code is its own best documentation.");
return 0;
}
#include<stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
printf("%d\n%d\n%d\n%d",a+b-16,a+b-3,a+b-1,a+b);
return 0;
}
#include<stdio.h>
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int a[200005],m,n,k,b,x=0,y=0,f=1;
scanf("%d %d %d",&n,&m,&k);
for(int i=1;i<=k;i++)
a[i]=0;
for(int i=0;i<n;i++)
{
scanf("%d",&b);
if(b<=k&&a[b]==0)
{
x++;
a[b]=1;
}
}
for(int i=0;i<m;i++)
{
scanf("%d",&b);
if(b<=k&&(a[b]==0||a[b]==1))
{
y++;
a[b]=2;
}
}
for(int i=1;i<=k;i++)
if(a[i]==0)
{
f=0;
break;
}
if(f==1&&(x>=k/2)&&(y>=k/2))
printf("yes\n");
else
printf("no\n");
}
return 0;
}