Thursday, May 15, 2014

Codechef May Challange 2014 OJUMPS - Chef-jumping solution

Codechef May Challange 2014 OJUMPS - Chef-jumping: http://www.codechef.com/MAY14/problems/OJUMPShttp://www.codechef.com/problems/OJUMPS/

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