Submission #5731

#TimeUsernameProblemLanguageResultExecution timeMemory
5731model_code관대한 주인 (TOKI14_generous)C++98
100 / 100
100 ms1088 KiB
/* * Official Solution * * Generous Butcher * William Gozali */ #include <cstdio> #define LL long long using namespace std; LL A, B, K1, K2; LL pouw(LL a, LL b, LL c){ if (b == 0) return 1; if (b & 1) return (a * pouw(a,b-1,c)) % c; LL t = pouw(a, b/2, c); return (t * t) % c; } int main() { scanf("%lld %lld %lld %lld", &A, &B, &K1, &K2); A %= B; for (LL i = K1; i <= K2; i++){ LL x = (A * pouw(10, i-1, B)) % B; printf("%lld", (x*10)/B); } printf("\n"); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...