Monthly Archives: May 2016

Codeforces 71A

#include<stdio.h> int main() { char s[1000]; int i,l,t,n;scanf(“%d”,&t); for(n=1;n<=t;n++) { scanf(“%s”,s); l=strlen(s); if(l<=10) printf(“%s\n”,s); if(l>10) { printf(“%c%d%c\n”,s[0],l-2,s[l-1]); } } return 0; }

Rate this:

Posted in Uncategorized | Leave a comment

Codeforces 4A

#include<stdio.h> int main() { int s,w; scanf(“%d”,&w); if(w<=2) printf(“NO\n”); else { s=(w%2==0)?1:0; if(s==1) printf(“YES\n”); else printf(“NO\n”); } }

Rate this:

Posted in Uncategorized | Leave a comment

Codeforces solution

My solved problems with solutions are 1A 4A 25A:IQ TEST 25B:Phone numbers 41A 59A:Word 61A:Ultra Fast Mathematician 71A 112A: Petya and Strings 137C History 155A: I_love_%username% 131C: The World is a Theatre 200B 208A.Dubstep 230A:Dragons 236A. Boy or Girl 😉 … Continue reading

Rate this:

Posted in Codeforces, Uncategorized | Tagged , , , , | Leave a comment

codeforces: 1A

#include<stdio.h> int main () { int n; int m; int a; scanf (“%d %d %d”, &n, &m, &a); printf (“%0.lf\n”, ceil(n / (double) a) * ceil (m / (double) a)); return 0; }

Rate this:

Posted in Uncategorized | Leave a comment

UVa Problems

TRY First, Here is some of my solved problrms UVa 100 113 : Power of cryptography 300: Maya Calendar 344 – Roman Digititis 336:A Node Too Far 352 – The Seasonal War UVa 369 424 – Integer Inquiry 459:Graph Connectivity 484:The … Continue reading

Rate this:

Posted in Uncategorized | Leave a comment

Online Judge solution

  UVa Online Judge LightOJ Uri Online Judge Codeforces SPOJ Hackerrank POJ Timus Solutions USACO Solutions UVAlive Solutions

Rate this:

Aside | Posted on by | Tagged , , , , | Leave a comment

Codeforces : 41A

Problem Id: 41A #Source Code   #include <stdio.h> #include<string.h> int main() { char n[20],m[20],c=0,temp; scanf(“%s”,n);int i,j,l2; int l=strlen(n); scanf(“%s”,m);l2=strlen(m); for(i=0,j=(l-1);i<l/2;i++,j–) { temp=n[i]; n[i]=n[j]; n[j]=temp; } if(l==l2){ for(i=0;i<l;i++) { if(m[i]==n[i]) c++; } if(c==l) printf(“YES\n”); else printf(“NO\n”);c=0; } else printf(“NO\n”);c=0; }

Rate this:

Posted in Uncategorized | Leave a comment