Skip to content

Instantly share code, notes, and snippets.

@shohan4556
Created February 26, 2015 18:37
Show Gist options
  • Select an option

  • Save shohan4556/9632c755b078acba763a to your computer and use it in GitHub Desktop.

Select an option

Save shohan4556/9632c755b078acba763a to your computer and use it in GitHub Desktop.
URI OJ 1743 solution
/// Author : Shohan
/// URI Oj - 1743 (Automated Checking Machine)
/// Mail : shohan4556@gmail.com
#include<stdio.h>
#define N 5
int correct[N];
void corre(int ara[]);
int main()
{
int ara1[N];
int i;
int ara2[N];
int ck;
while(scanf("%d",&ara1[0])==1){
for(i=1;i<N;i++){
scanf("%d",&ara1[i]);
}
corre(ara1);
ck=0;
for(i=0;i<N;i++){
scanf("%d",&ara2[i]);
if(ara2[i]==correct[i])
ck++;
else
ck=0;
}
if(ck==5)
printf("Y\n");
else
printf("N\n");
}
return 0;
}
void corre(int ara[])
{
int i;
for(i=0;i<5;i++){
if(ara[i]==1)
correct[i]=0;
else
correct[i]=1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment