Wednesday, January 15, 2014

codechef PLZLYKME - "please like me" solution

codechef PLZLYKME - "please like me": http://www.codechef.com/problems/PLZLYKME

codechef PLZLYKME - "please like me" solution: http://ideone.com/tN7fUo

#include <iostream>
#include <cstdio>
using namespace std;

int main() {
int t;
long long l, d, s, c;
scanf("%d", &t);
while(t--) {
scanf("%lld %lld %lld %lld", &l ,&d, &s, &c);
for(int i=1; i<d; i++) { s+=s*c; if(s>=l) break; }
if(s>=l) printf("ALIVE AND KICKING\n");
else printf("DEAD AND ROTTING\n");
}
return 0;
}

No comments:

Post a Comment