Codechef May Challange 2014 OJUMPS - Chef-jumping editorial: http://discuss.codechef.com/questions/42547/ojumps-editorial
Codechef May Challange 2014 OJUMPS - Chef-jumping solution: http://ideone.com/h9JOWO
#include <iostream> #include <cstdio> using namespace std; int main() { long long int a, b=1; scanf("%I64d", &a); a%=6; while(a>0) { a-=b; b++; if(b==4) b=1; } if(a==0) printf("yes"); else printf("no"); return 0; }
No comments:
Post a Comment