Monthly Archives: June 2016

Uva 621:Secret Research

Problem Link A hard tiring problem !Many loopholes,many many,use http://www.udebug.com <Source Code> #include<stdio.h> #include<string.h> int main() { char a[10000];int n,t,l,i; scanf(“%d%*c”,&t); i=1;while(t–) {l=0; gets(a); l=strlen(a); if(a[0]==’9′ && a[l-1]==’4′) printf(“*\n”); else if((a[0]==’1’&&l==1||(l==1 && a[0]==’4′))) printf(“+\n”); else if(a[l-2]==’3′ &&a[l-1]==’5′) printf(“-\n”); else if((a[0]==’1’&&a[l-1]==’1′)||(a[0]==’1’&&a[l-1]==’4′)||(a[0]==’1’&&a[l-2]==’7’&&a[l-1]==’8′)) … Continue reading

Rate this:

Posted in Uncategorized | Leave a comment

Uri 1332:One Two Three

Problem Link <Source Code> # include <stdio.h> # include <string.h> # include <ctype.h> int main() { int n; char a[7],chr; scanf(“%d”,&n); getchar(); while(n–) { gets(a); if(strlen(a)==5) printf(“3\n”); else if((a[0]==’o’ && a[1]==’n’)|| (a[0]==’o’ && a[1]==’e’)|| (a[1]==’n’ && a[2]==’e’)|| (a[0]==’o’ && a[2]==’e’)|| … Continue reading

Rate this:

Posted in Uncategorized | Tagged , , | Leave a comment

Uri 1914:Whose Turn Is It?

Problem Link Let’s make our turn 😉 \(^_^)/ <Source Code> #include<stdio.h> #include<string.h> int main() { char a[1000],b[20],c[10000],d[20]; long long i,n,x,y; scanf(“%lld”,&n); while(n–) { scanf(“%s %s %s %s”,a,b,c,d); scanf(“%lld %lld”,&x,&y); i=x+y; if(b[0]==’P’) { if(i%2==0) printf(“%s\n”,a); else printf(“%s\n”,c); } else { if(i%2==0) … Continue reading

Rate this:

Posted in Uncategorized | Leave a comment

URI 1930-Electrical Outlet

Problem Link <Source Code> #include<stdio.h> int main() { int s=0,n[4],i; for(i=0;i<4;i++) { scanf(“%d”,&n[i]); s+=n[i]; } printf(“%d\n”,s-3); }

Rate this:

Posted in Uncategorized | Leave a comment

Uri 1234:Dancing Sentence

Problem link   Source Code: #include <stdio.h> #include <string.h> int main() { char a[1000]; int i,j,k,l,n,m; while(gets(a) != NULL) { k = strlen(a); n=0; for (i=0;i<k;i++) { if(a[i] != ‘ ‘) { n++; if(n%2 != 0) { if(a[i]>=’a’ && a[i]<= … Continue reading

Rate this:

Posted in Uncategorized | Leave a comment

Uri 1943 : Top N

Problem link:  Source Code: #include <stdio.h> int main(){ int n; scanf(“%d”, &n); if(n == 1) printf(“Top 1\n”); else if(n > 1 && n <= 3) printf(“Top 3\n”); else if(n > 3 && n <= 5) printf(“Top 5\n”); else if(n > … Continue reading

Rate this:

Posted in Uncategorized | Tagged | Leave a comment

UVa 10340:All in All

Problem Link <Source Code> #include<stdio.h> #include<string.h> int main() { char a1[100000],a2[100000]; while(scanf(“%s %s”,a1,a2)!=EOF){ if(strlen(a1)>strlen(a2)) printf(“No\n”); else{ long long int index=0,i; for(i=0;i<strlen(a2);i++) {if(a1[index]==a2[i]) index++; } if(index==strlen(a1)) printf(“Yes\n”); else printf(“No\n”); } } return 0; }

Rate this:

Posted in Uncategorized | Tagged , , | Leave a comment