Submission #2520

# Submission time Handle Problem Language Result Execution time Memory
2520 2013-07-23T04:56:30 Z kipa00 생일수 I (GA4_birthday1) C++
100 / 100
74 ms 884 KB
#include <cstdio>
using namespace std;

int T, N;
int threes, fives, eights;
unsigned int i;

int t[8] = {0, 3, 0, 1, 0, 0, 2, 0};
int f[8] = {0, 0, 2, 0, 4, 1, 0, 3};
int e[8] = {0, 1, 1, 0, 2, 0, 0, 1};
int small[8] = {-1, -1, -1, 3, -1, 5, 33, -1};

void makeinput(char c, int count) {
    while (count--) {
        printf("%c", c);
    }
}

int main() {
    scanf("%d", &T);
    while (T--) {
        threes = fives = eights = 0;
        scanf("%d", &N);
        if (N == 12) {
            printf("3333\n");
            continue;
        } else if (N < 8) {
            printf("%d\n", small[N]);
            continue;
        }
        eights = N / 8;
        N %= 8;
        threes += t[N]; fives += f[N]; eights -= e[N];
        makeinput('3', threes);
        makeinput('5', fives);
        makeinput('8', eights);
        printf("\n");
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 884 KB Output is correct
2 Correct 0 ms 884 KB Output is correct
3 Correct 0 ms 884 KB Output is correct
4 Correct 0 ms 884 KB Output is correct
5 Correct 0 ms 884 KB Output is correct
6 Correct 0 ms 884 KB Output is correct
7 Correct 0 ms 884 KB Output is correct
8 Correct 0 ms 884 KB Output is correct
9 Correct 0 ms 884 KB Output is correct
10 Correct 0 ms 884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 66 ms 884 KB Output is correct
2 Correct 60 ms 884 KB Output is correct
3 Correct 67 ms 884 KB Output is correct
4 Correct 59 ms 884 KB Output is correct
5 Correct 60 ms 884 KB Output is correct
6 Correct 66 ms 884 KB Output is correct
7 Correct 66 ms 884 KB Output is correct
8 Correct 67 ms 884 KB Output is correct
9 Correct 74 ms 884 KB Output is correct
10 Correct 63 ms 884 KB Output is correct
11 Correct 61 ms 884 KB Output is correct
12 Correct 70 ms 884 KB Output is correct
13 Correct 65 ms 884 KB Output is correct
14 Correct 70 ms 884 KB Output is correct
15 Correct 64 ms 884 KB Output is correct
16 Correct 58 ms 884 KB Output is correct
17 Correct 60 ms 884 KB Output is correct
18 Correct 62 ms 884 KB Output is correct
19 Correct 72 ms 884 KB Output is correct
20 Correct 66 ms 884 KB Output is correct
21 Correct 65 ms 884 KB Output is correct
22 Correct 63 ms 884 KB Output is correct
23 Correct 65 ms 884 KB Output is correct
24 Correct 62 ms 884 KB Output is correct
25 Correct 65 ms 884 KB Output is correct