답안 #13728

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
13728 2015-03-28T15:40:06 Z gs14004 관대한 주인 (TOKI14_generous) C++14
65 / 100
8 ms 1084 KB
#include <cstdio>

long long pw(int a, int x, int m){
    long long r = a, p = 10;
    while (x) {
        if(x&1) r *= p;
        p *= p;
        r %= (10ll * m);
        p %= (10ll * m);
        x >>= 1;
    }
    return r;
}

int main(){
    int a,b,s,e;
    scanf("%d %d %d %d",&a,&b,&s,&e);
    long long t = pw(a,s,b);
    for (int i=s; i<=e; i++) {
        printf("%lld",t/b);
        t %= b;
        t *= 10;
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
5 Correct 0 ms 1084 KB Output is correct
6 Correct 0 ms 1084 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
5 Correct 0 ms 1084 KB Output is correct
6 Correct 0 ms 1084 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
5 Correct 0 ms 1084 KB Output is correct
6 Correct 0 ms 1084 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
5 Correct 0 ms 1084 KB Output is correct
6 Correct 0 ms 1084 KB Output is correct
7 Correct 0 ms 1084 KB Output is correct
8 Correct 0 ms 1084 KB Output is correct
9 Correct 0 ms 1084 KB Output is correct
10 Correct 0 ms 1084 KB Output is correct
11 Incorrect 0 ms 1084 KB Output isn't correct
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 8 ms 1084 KB Output isn't correct
2 Halted 0 ms 0 KB -