Submission #5731

# Submission time Handle Problem Language Result Execution time Memory
5731 2014-05-14T14:54:24 Z model_code 관대한 주인 (TOKI14_generous) C++
100 / 100
100 ms 1088 KB
/*
 * 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 time Memory Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
6 Correct 0 ms 1088 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
6 Correct 0 ms 1088 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
6 Correct 0 ms 1088 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
6 Correct 0 ms 1088 KB Output is correct
7 Correct 0 ms 1088 KB Output is correct
8 Correct 0 ms 1088 KB Output is correct
9 Correct 0 ms 1088 KB Output is correct
10 Correct 0 ms 1088 KB Output is correct
11 Correct 0 ms 1088 KB Output is correct
12 Correct 0 ms 1088 KB Output is correct
13 Correct 0 ms 1088 KB Output is correct
14 Correct 0 ms 1088 KB Output is correct
15 Correct 0 ms 1088 KB Output is correct
16 Correct 0 ms 1088 KB Output is correct
17 Correct 0 ms 1088 KB Output is correct
18 Correct 0 ms 1088 KB Output is correct
19 Correct 0 ms 1088 KB Output is correct
20 Correct 0 ms 1088 KB Output is correct
21 Correct 0 ms 1088 KB Output is correct
22 Correct 0 ms 1088 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 100 ms 1088 KB Output is correct
2 Correct 20 ms 1088 KB Output is correct
3 Correct 48 ms 1088 KB Output is correct
4 Correct 80 ms 1088 KB Output is correct