답안 #572481

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
572481 2022-06-04T13:15:22 Z model_code 화성 (APIO22_mars) C++17
100 / 100
1733 ms 4728 KB
#include "bits/stdc++.h"
#include "mars.h"
using namespace std;
 
const int W = 100;
const int B = 9;
using word = bitset <W>;
 
struct DSU{
    vector <int> e;
    DSU(int n) : e(n ,-1) {}
    int find(int x) { return e[x] < 0? x : e[x] = find(e[x]); }
    void join(int x ,int y){
        x = find(x) ,y = find(y);
        if(x && y && x != y)
            e[x] += e[y] ,e[y] = x;
    }
};
 
word encode(vector <int> e){
    int l = e.size();
    e.resize(l+2);
    vector <int> fst(l+1 ,-1) ,lst(l+1 ,-1);
    for(int i = 0; i < e.size(); i++) if(e[i]){
        fst[e[i]] = ~fst[e[i]]? fst[e[i]] : i;
        lst[e[i]] = i;
    }
    for(int i = 0; i < e.size(); i++) if(e[i]){
        if(fst[e[i]] == lst[e[i]]) e[i] = 1;
        else if(i == fst[e[i]])    e[i] = 2;
        else if(i == lst[e[i]])    e[i] = 3;
        else                       e[i] = 4;
    }
    word w;
    for(int i = 0; i+2 < e.size(); i += 3){
        int m = e[i] + e[i+1]*5 + e[i+2]*25;
        for(int j = 0; j < 7; j++)
            w[7*i/3+j] = m>>j&1;
    }
    return w;
}
vector <int> decode(word w ,int l){
    if(l == 1) return {w.any()};
    vector <int> e(l+2);
    for(int i = 0; i+2 < e.size(); i += 3){
        int m = 0;
        for(int j = 0; j < 7; j++)
            m |= w[7*i/3+j]<<j;
        e[i] = m%5;
        e[i+1] = (m/5)%5;
        e[i+2] = (m/25)%5;
    }
    vector <int> b;
    for(int id = 0 ,i = 0; i < e.size(); i++) if(e[i]){
        if(e[i] == 1)      { e[i] = ++id; }
        else if(e[i] == 2) { e[i] = ++id; b.push_back(id); }
        else if(e[i] == 3) { e[i] = b.back(); b.pop_back(); }
        else if(e[i] == 4) { e[i] = b.back(); }
    }
    e.resize(l);
    return e;
}
 
int diagLen(int i ,int j ,int n){
    return n - abs(i - j);
}
int diagOrd(int i ,int j ,int n){
    return diagLen(i ,j ,n) - min(i ,j) - 1;
}
 
pair <int ,vector <int>> buffer(vector<vector<word>> a ,int i ,int j ,int n){
    DSU d(3*n);
    vector <word> diag = {a[0][0]|a[1][1]|a[2][2] ,a[1][0]|a[2][1]};
    vector <int> diagConn[3] = {{} ,{} ,decode(a[2][0] ,diagLen(i+2 ,j ,n))};
    for(int id = n ,r = 1; r >= 0; r--){
        for(int k = 0; k < diagLen(i+r ,j ,n); k++){
            diagConn[r].push_back(diag[r][diagOrd(i+r+k ,j+k ,n)]? ++id : 0);
            if(k < diagConn[r+1].size())
                d.join(diagConn[r][k] ,diagConn[r+1][k]);
            if(k > 0)
                d.join(diagConn[r][k] ,diagConn[r+1][k-1]);
        }
    }
 
    int compsCnt = (a[2][0] >> (W-B)).to_ulong();
    vector <int> mp(3*n ,-1); mp[0] = 0;
    for(int id = 0 ,r = 0; r < 3; r++){
        for(int&k : diagConn[r]){
            k = d.find(k);
            compsCnt += (r && mp[k] == -1);
            k = ~mp[k]? mp[k] : mp[k] = ++id;
        }
    }
 
    return {compsCnt ,diagConn[0]};
}
 
string process(vector<vector<string>> a ,int i ,int j ,int k ,int n)
{
    vector<vector<word>> b(3 ,vector<word>(3));
    for(int y = 0; y < 3; y++)
    for(int x = 0; x < 3; x++)
    {
        reverse(a[y][x].begin(),a[y][x].end());
        b[y][x] = word(a[y][x]);
    }
 
    n = 2*n+1 ,k = 2*k+3;
    auto transpose = [&](){
        swap(i ,j);
        swap(b[0][1] ,b[1][0]);
        swap(b[0][2] ,b[2][0]);
        swap(b[1][2] ,b[2][1]);
    };
    if(j == n-k && i == 0)
        transpose();
 
    if(k == 3){ //first phase
        for(int y = 0; y < 3; y++)
        for(int x = 0; x < 3; x++)
            b[y][x] <<= diagOrd(i+y ,j+x ,n);
    }
    if(k != n){ //not last phase
        b[0][0] |= b[1][1] | b[2][2];
    }
 
    if(k == n){ //last phase
        auto [cnt1 ,conn1] = buffer(b ,i ,j ,n);
        transpose();
        auto [cnt2 ,conn2] = buffer(b ,i ,j ,n);
 
        DSU d(n+1);
        for(auto&conn : {conn1 ,conn2}){
            vector <int> lst(n+1 ,-1);
            for(int l = 0; l < n; l++) if(conn[l]){
                if(~lst[conn[l]])
                    d.join(lst[conn[l]] ,l+1);
                lst[conn[l]] = l+1;
            }
        }
 
        cnt1 += cnt2;
        for(int l = 0; l < n; l++) if(conn1[l])
            cnt1 += l+1 == d.find(l+1);
        b[0][0] = word(cnt1);
    }
    else if(i == n-k && j == 0){ //first star
        auto [cnt ,conn] = buffer(b ,i ,j ,n);
        b[0][0] = (word(cnt) << (W-B)) | encode(conn);
    }
    string ret=b[0][0].to_string();
    reverse(ret.begin(),ret.end());
    return ret;
}

Compilation message

mars.cpp: In function 'word encode(std::vector<int>)':
mars.cpp:24:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |     for(int i = 0; i < e.size(); i++) if(e[i]){
      |                    ~~^~~~~~~~~~
mars.cpp:28:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |     for(int i = 0; i < e.size(); i++) if(e[i]){
      |                    ~~^~~~~~~~~~
mars.cpp:35:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |     for(int i = 0; i+2 < e.size(); i += 3){
      |                    ~~~~^~~~~~~~~~
mars.cpp: In function 'std::vector<int> decode(word, int)':
mars.cpp:45:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |     for(int i = 0; i+2 < e.size(); i += 3){
      |                    ~~~~^~~~~~~~~~
mars.cpp:54:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   54 |     for(int id = 0 ,i = 0; i < e.size(); i++) if(e[i]){
      |                            ~~^~~~~~~~~~
mars.cpp: In function 'std::pair<int, std::vector<int> > buffer(std::vector<std::vector<std::bitset<100> > >, int, int, int)':
mars.cpp:78:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   78 |             if(k < diagConn[r+1].size())
      |                ~~^~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 1956 KB Output is correct
2 Correct 8 ms 1972 KB Output is correct
3 Correct 8 ms 1884 KB Output is correct
4 Correct 8 ms 2004 KB Output is correct
5 Correct 8 ms 2132 KB Output is correct
6 Correct 8 ms 2036 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 1956 KB Output is correct
2 Correct 8 ms 1972 KB Output is correct
3 Correct 8 ms 1884 KB Output is correct
4 Correct 8 ms 2004 KB Output is correct
5 Correct 8 ms 2132 KB Output is correct
6 Correct 8 ms 2036 KB Output is correct
7 Correct 11 ms 1940 KB Output is correct
8 Correct 17 ms 1936 KB Output is correct
9 Correct 17 ms 1932 KB Output is correct
10 Correct 19 ms 2252 KB Output is correct
11 Correct 19 ms 2176 KB Output is correct
12 Correct 19 ms 2132 KB Output is correct
13 Correct 20 ms 2156 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 1956 KB Output is correct
2 Correct 8 ms 1972 KB Output is correct
3 Correct 8 ms 1884 KB Output is correct
4 Correct 8 ms 2004 KB Output is correct
5 Correct 8 ms 2132 KB Output is correct
6 Correct 8 ms 2036 KB Output is correct
7 Correct 11 ms 1940 KB Output is correct
8 Correct 17 ms 1936 KB Output is correct
9 Correct 17 ms 1932 KB Output is correct
10 Correct 19 ms 2252 KB Output is correct
11 Correct 19 ms 2176 KB Output is correct
12 Correct 19 ms 2132 KB Output is correct
13 Correct 20 ms 2156 KB Output is correct
14 Correct 36 ms 2048 KB Output is correct
15 Correct 42 ms 2460 KB Output is correct
16 Correct 49 ms 2480 KB Output is correct
17 Correct 47 ms 2576 KB Output is correct
18 Correct 46 ms 2492 KB Output is correct
19 Correct 51 ms 2600 KB Output is correct
20 Correct 52 ms 2528 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 1956 KB Output is correct
2 Correct 8 ms 1972 KB Output is correct
3 Correct 8 ms 1884 KB Output is correct
4 Correct 8 ms 2004 KB Output is correct
5 Correct 8 ms 2132 KB Output is correct
6 Correct 8 ms 2036 KB Output is correct
7 Correct 11 ms 1940 KB Output is correct
8 Correct 17 ms 1936 KB Output is correct
9 Correct 17 ms 1932 KB Output is correct
10 Correct 19 ms 2252 KB Output is correct
11 Correct 19 ms 2176 KB Output is correct
12 Correct 19 ms 2132 KB Output is correct
13 Correct 20 ms 2156 KB Output is correct
14 Correct 36 ms 2048 KB Output is correct
15 Correct 42 ms 2460 KB Output is correct
16 Correct 49 ms 2480 KB Output is correct
17 Correct 47 ms 2576 KB Output is correct
18 Correct 46 ms 2492 KB Output is correct
19 Correct 51 ms 2600 KB Output is correct
20 Correct 52 ms 2528 KB Output is correct
21 Correct 71 ms 2496 KB Output is correct
22 Correct 112 ms 2644 KB Output is correct
23 Correct 104 ms 2716 KB Output is correct
24 Correct 107 ms 2764 KB Output is correct
25 Correct 108 ms 2832 KB Output is correct
26 Correct 99 ms 2668 KB Output is correct
27 Correct 112 ms 2660 KB Output is correct
28 Correct 104 ms 2660 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 1956 KB Output is correct
2 Correct 8 ms 1972 KB Output is correct
3 Correct 8 ms 1884 KB Output is correct
4 Correct 8 ms 2004 KB Output is correct
5 Correct 8 ms 2132 KB Output is correct
6 Correct 8 ms 2036 KB Output is correct
7 Correct 11 ms 1940 KB Output is correct
8 Correct 17 ms 1936 KB Output is correct
9 Correct 17 ms 1932 KB Output is correct
10 Correct 19 ms 2252 KB Output is correct
11 Correct 19 ms 2176 KB Output is correct
12 Correct 19 ms 2132 KB Output is correct
13 Correct 20 ms 2156 KB Output is correct
14 Correct 36 ms 2048 KB Output is correct
15 Correct 42 ms 2460 KB Output is correct
16 Correct 49 ms 2480 KB Output is correct
17 Correct 47 ms 2576 KB Output is correct
18 Correct 46 ms 2492 KB Output is correct
19 Correct 51 ms 2600 KB Output is correct
20 Correct 52 ms 2528 KB Output is correct
21 Correct 71 ms 2496 KB Output is correct
22 Correct 112 ms 2644 KB Output is correct
23 Correct 104 ms 2716 KB Output is correct
24 Correct 107 ms 2764 KB Output is correct
25 Correct 108 ms 2832 KB Output is correct
26 Correct 99 ms 2668 KB Output is correct
27 Correct 112 ms 2660 KB Output is correct
28 Correct 104 ms 2660 KB Output is correct
29 Correct 154 ms 2764 KB Output is correct
30 Correct 190 ms 2808 KB Output is correct
31 Correct 205 ms 2812 KB Output is correct
32 Correct 187 ms 2812 KB Output is correct
33 Correct 205 ms 2784 KB Output is correct
34 Correct 208 ms 2804 KB Output is correct
35 Correct 193 ms 2964 KB Output is correct
36 Correct 208 ms 2884 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 1956 KB Output is correct
2 Correct 8 ms 1972 KB Output is correct
3 Correct 8 ms 1884 KB Output is correct
4 Correct 8 ms 2004 KB Output is correct
5 Correct 8 ms 2132 KB Output is correct
6 Correct 8 ms 2036 KB Output is correct
7 Correct 11 ms 1940 KB Output is correct
8 Correct 17 ms 1936 KB Output is correct
9 Correct 17 ms 1932 KB Output is correct
10 Correct 19 ms 2252 KB Output is correct
11 Correct 19 ms 2176 KB Output is correct
12 Correct 19 ms 2132 KB Output is correct
13 Correct 20 ms 2156 KB Output is correct
14 Correct 36 ms 2048 KB Output is correct
15 Correct 42 ms 2460 KB Output is correct
16 Correct 49 ms 2480 KB Output is correct
17 Correct 47 ms 2576 KB Output is correct
18 Correct 46 ms 2492 KB Output is correct
19 Correct 51 ms 2600 KB Output is correct
20 Correct 52 ms 2528 KB Output is correct
21 Correct 71 ms 2496 KB Output is correct
22 Correct 112 ms 2644 KB Output is correct
23 Correct 104 ms 2716 KB Output is correct
24 Correct 107 ms 2764 KB Output is correct
25 Correct 108 ms 2832 KB Output is correct
26 Correct 99 ms 2668 KB Output is correct
27 Correct 112 ms 2660 KB Output is correct
28 Correct 104 ms 2660 KB Output is correct
29 Correct 154 ms 2764 KB Output is correct
30 Correct 190 ms 2808 KB Output is correct
31 Correct 205 ms 2812 KB Output is correct
32 Correct 187 ms 2812 KB Output is correct
33 Correct 205 ms 2784 KB Output is correct
34 Correct 208 ms 2804 KB Output is correct
35 Correct 193 ms 2964 KB Output is correct
36 Correct 208 ms 2884 KB Output is correct
37 Correct 265 ms 3188 KB Output is correct
38 Correct 338 ms 3140 KB Output is correct
39 Correct 338 ms 3268 KB Output is correct
40 Correct 348 ms 3320 KB Output is correct
41 Correct 335 ms 3188 KB Output is correct
42 Correct 328 ms 3212 KB Output is correct
43 Correct 322 ms 3276 KB Output is correct
44 Correct 334 ms 3272 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 1956 KB Output is correct
2 Correct 8 ms 1972 KB Output is correct
3 Correct 8 ms 1884 KB Output is correct
4 Correct 8 ms 2004 KB Output is correct
5 Correct 8 ms 2132 KB Output is correct
6 Correct 8 ms 2036 KB Output is correct
7 Correct 11 ms 1940 KB Output is correct
8 Correct 17 ms 1936 KB Output is correct
9 Correct 17 ms 1932 KB Output is correct
10 Correct 19 ms 2252 KB Output is correct
11 Correct 19 ms 2176 KB Output is correct
12 Correct 19 ms 2132 KB Output is correct
13 Correct 20 ms 2156 KB Output is correct
14 Correct 36 ms 2048 KB Output is correct
15 Correct 42 ms 2460 KB Output is correct
16 Correct 49 ms 2480 KB Output is correct
17 Correct 47 ms 2576 KB Output is correct
18 Correct 46 ms 2492 KB Output is correct
19 Correct 51 ms 2600 KB Output is correct
20 Correct 52 ms 2528 KB Output is correct
21 Correct 71 ms 2496 KB Output is correct
22 Correct 112 ms 2644 KB Output is correct
23 Correct 104 ms 2716 KB Output is correct
24 Correct 107 ms 2764 KB Output is correct
25 Correct 108 ms 2832 KB Output is correct
26 Correct 99 ms 2668 KB Output is correct
27 Correct 112 ms 2660 KB Output is correct
28 Correct 104 ms 2660 KB Output is correct
29 Correct 154 ms 2764 KB Output is correct
30 Correct 190 ms 2808 KB Output is correct
31 Correct 205 ms 2812 KB Output is correct
32 Correct 187 ms 2812 KB Output is correct
33 Correct 205 ms 2784 KB Output is correct
34 Correct 208 ms 2804 KB Output is correct
35 Correct 193 ms 2964 KB Output is correct
36 Correct 208 ms 2884 KB Output is correct
37 Correct 265 ms 3188 KB Output is correct
38 Correct 338 ms 3140 KB Output is correct
39 Correct 338 ms 3268 KB Output is correct
40 Correct 348 ms 3320 KB Output is correct
41 Correct 335 ms 3188 KB Output is correct
42 Correct 328 ms 3212 KB Output is correct
43 Correct 322 ms 3276 KB Output is correct
44 Correct 334 ms 3272 KB Output is correct
45 Correct 428 ms 3348 KB Output is correct
46 Correct 524 ms 3412 KB Output is correct
47 Correct 538 ms 3384 KB Output is correct
48 Correct 531 ms 3492 KB Output is correct
49 Correct 533 ms 3556 KB Output is correct
50 Correct 539 ms 3516 KB Output is correct
51 Correct 558 ms 3384 KB Output is correct
52 Correct 559 ms 3540 KB Output is correct
53 Correct 530 ms 3608 KB Output is correct
54 Correct 550 ms 3472 KB Output is correct
55 Correct 542 ms 3404 KB Output is correct
56 Correct 525 ms 3320 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 1956 KB Output is correct
2 Correct 8 ms 1972 KB Output is correct
3 Correct 8 ms 1884 KB Output is correct
4 Correct 8 ms 2004 KB Output is correct
5 Correct 8 ms 2132 KB Output is correct
6 Correct 8 ms 2036 KB Output is correct
7 Correct 11 ms 1940 KB Output is correct
8 Correct 17 ms 1936 KB Output is correct
9 Correct 17 ms 1932 KB Output is correct
10 Correct 19 ms 2252 KB Output is correct
11 Correct 19 ms 2176 KB Output is correct
12 Correct 19 ms 2132 KB Output is correct
13 Correct 20 ms 2156 KB Output is correct
14 Correct 36 ms 2048 KB Output is correct
15 Correct 42 ms 2460 KB Output is correct
16 Correct 49 ms 2480 KB Output is correct
17 Correct 47 ms 2576 KB Output is correct
18 Correct 46 ms 2492 KB Output is correct
19 Correct 51 ms 2600 KB Output is correct
20 Correct 52 ms 2528 KB Output is correct
21 Correct 71 ms 2496 KB Output is correct
22 Correct 112 ms 2644 KB Output is correct
23 Correct 104 ms 2716 KB Output is correct
24 Correct 107 ms 2764 KB Output is correct
25 Correct 108 ms 2832 KB Output is correct
26 Correct 99 ms 2668 KB Output is correct
27 Correct 112 ms 2660 KB Output is correct
28 Correct 104 ms 2660 KB Output is correct
29 Correct 154 ms 2764 KB Output is correct
30 Correct 190 ms 2808 KB Output is correct
31 Correct 205 ms 2812 KB Output is correct
32 Correct 187 ms 2812 KB Output is correct
33 Correct 205 ms 2784 KB Output is correct
34 Correct 208 ms 2804 KB Output is correct
35 Correct 193 ms 2964 KB Output is correct
36 Correct 208 ms 2884 KB Output is correct
37 Correct 265 ms 3188 KB Output is correct
38 Correct 338 ms 3140 KB Output is correct
39 Correct 338 ms 3268 KB Output is correct
40 Correct 348 ms 3320 KB Output is correct
41 Correct 335 ms 3188 KB Output is correct
42 Correct 328 ms 3212 KB Output is correct
43 Correct 322 ms 3276 KB Output is correct
44 Correct 334 ms 3272 KB Output is correct
45 Correct 428 ms 3348 KB Output is correct
46 Correct 524 ms 3412 KB Output is correct
47 Correct 538 ms 3384 KB Output is correct
48 Correct 531 ms 3492 KB Output is correct
49 Correct 533 ms 3556 KB Output is correct
50 Correct 539 ms 3516 KB Output is correct
51 Correct 558 ms 3384 KB Output is correct
52 Correct 559 ms 3540 KB Output is correct
53 Correct 530 ms 3608 KB Output is correct
54 Correct 550 ms 3472 KB Output is correct
55 Correct 542 ms 3404 KB Output is correct
56 Correct 525 ms 3320 KB Output is correct
57 Correct 673 ms 3780 KB Output is correct
58 Correct 789 ms 3884 KB Output is correct
59 Correct 817 ms 3928 KB Output is correct
60 Correct 807 ms 4148 KB Output is correct
61 Correct 803 ms 4076 KB Output is correct
62 Correct 812 ms 3920 KB Output is correct
63 Correct 809 ms 4076 KB Output is correct
64 Correct 794 ms 4140 KB Output is correct
65 Correct 800 ms 4080 KB Output is correct
66 Correct 788 ms 4000 KB Output is correct
67 Correct 766 ms 4048 KB Output is correct
68 Correct 779 ms 4012 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 1956 KB Output is correct
2 Correct 8 ms 1972 KB Output is correct
3 Correct 8 ms 1884 KB Output is correct
4 Correct 8 ms 2004 KB Output is correct
5 Correct 8 ms 2132 KB Output is correct
6 Correct 8 ms 2036 KB Output is correct
7 Correct 11 ms 1940 KB Output is correct
8 Correct 17 ms 1936 KB Output is correct
9 Correct 17 ms 1932 KB Output is correct
10 Correct 19 ms 2252 KB Output is correct
11 Correct 19 ms 2176 KB Output is correct
12 Correct 19 ms 2132 KB Output is correct
13 Correct 20 ms 2156 KB Output is correct
14 Correct 36 ms 2048 KB Output is correct
15 Correct 42 ms 2460 KB Output is correct
16 Correct 49 ms 2480 KB Output is correct
17 Correct 47 ms 2576 KB Output is correct
18 Correct 46 ms 2492 KB Output is correct
19 Correct 51 ms 2600 KB Output is correct
20 Correct 52 ms 2528 KB Output is correct
21 Correct 71 ms 2496 KB Output is correct
22 Correct 112 ms 2644 KB Output is correct
23 Correct 104 ms 2716 KB Output is correct
24 Correct 107 ms 2764 KB Output is correct
25 Correct 108 ms 2832 KB Output is correct
26 Correct 99 ms 2668 KB Output is correct
27 Correct 112 ms 2660 KB Output is correct
28 Correct 104 ms 2660 KB Output is correct
29 Correct 154 ms 2764 KB Output is correct
30 Correct 190 ms 2808 KB Output is correct
31 Correct 205 ms 2812 KB Output is correct
32 Correct 187 ms 2812 KB Output is correct
33 Correct 205 ms 2784 KB Output is correct
34 Correct 208 ms 2804 KB Output is correct
35 Correct 193 ms 2964 KB Output is correct
36 Correct 208 ms 2884 KB Output is correct
37 Correct 265 ms 3188 KB Output is correct
38 Correct 338 ms 3140 KB Output is correct
39 Correct 338 ms 3268 KB Output is correct
40 Correct 348 ms 3320 KB Output is correct
41 Correct 335 ms 3188 KB Output is correct
42 Correct 328 ms 3212 KB Output is correct
43 Correct 322 ms 3276 KB Output is correct
44 Correct 334 ms 3272 KB Output is correct
45 Correct 428 ms 3348 KB Output is correct
46 Correct 524 ms 3412 KB Output is correct
47 Correct 538 ms 3384 KB Output is correct
48 Correct 531 ms 3492 KB Output is correct
49 Correct 533 ms 3556 KB Output is correct
50 Correct 539 ms 3516 KB Output is correct
51 Correct 558 ms 3384 KB Output is correct
52 Correct 559 ms 3540 KB Output is correct
53 Correct 530 ms 3608 KB Output is correct
54 Correct 550 ms 3472 KB Output is correct
55 Correct 542 ms 3404 KB Output is correct
56 Correct 525 ms 3320 KB Output is correct
57 Correct 673 ms 3780 KB Output is correct
58 Correct 789 ms 3884 KB Output is correct
59 Correct 817 ms 3928 KB Output is correct
60 Correct 807 ms 4148 KB Output is correct
61 Correct 803 ms 4076 KB Output is correct
62 Correct 812 ms 3920 KB Output is correct
63 Correct 809 ms 4076 KB Output is correct
64 Correct 794 ms 4140 KB Output is correct
65 Correct 800 ms 4080 KB Output is correct
66 Correct 788 ms 4000 KB Output is correct
67 Correct 766 ms 4048 KB Output is correct
68 Correct 779 ms 4012 KB Output is correct
69 Correct 970 ms 4132 KB Output is correct
70 Correct 1109 ms 4372 KB Output is correct
71 Correct 1128 ms 4248 KB Output is correct
72 Correct 1110 ms 4340 KB Output is correct
73 Correct 1149 ms 4396 KB Output is correct
74 Correct 1130 ms 4232 KB Output is correct
75 Correct 1133 ms 4256 KB Output is correct
76 Correct 1132 ms 4260 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 1956 KB Output is correct
2 Correct 8 ms 1972 KB Output is correct
3 Correct 8 ms 1884 KB Output is correct
4 Correct 8 ms 2004 KB Output is correct
5 Correct 8 ms 2132 KB Output is correct
6 Correct 8 ms 2036 KB Output is correct
7 Correct 11 ms 1940 KB Output is correct
8 Correct 17 ms 1936 KB Output is correct
9 Correct 17 ms 1932 KB Output is correct
10 Correct 19 ms 2252 KB Output is correct
11 Correct 19 ms 2176 KB Output is correct
12 Correct 19 ms 2132 KB Output is correct
13 Correct 20 ms 2156 KB Output is correct
14 Correct 36 ms 2048 KB Output is correct
15 Correct 42 ms 2460 KB Output is correct
16 Correct 49 ms 2480 KB Output is correct
17 Correct 47 ms 2576 KB Output is correct
18 Correct 46 ms 2492 KB Output is correct
19 Correct 51 ms 2600 KB Output is correct
20 Correct 52 ms 2528 KB Output is correct
21 Correct 71 ms 2496 KB Output is correct
22 Correct 112 ms 2644 KB Output is correct
23 Correct 104 ms 2716 KB Output is correct
24 Correct 107 ms 2764 KB Output is correct
25 Correct 108 ms 2832 KB Output is correct
26 Correct 99 ms 2668 KB Output is correct
27 Correct 112 ms 2660 KB Output is correct
28 Correct 104 ms 2660 KB Output is correct
29 Correct 154 ms 2764 KB Output is correct
30 Correct 190 ms 2808 KB Output is correct
31 Correct 205 ms 2812 KB Output is correct
32 Correct 187 ms 2812 KB Output is correct
33 Correct 205 ms 2784 KB Output is correct
34 Correct 208 ms 2804 KB Output is correct
35 Correct 193 ms 2964 KB Output is correct
36 Correct 208 ms 2884 KB Output is correct
37 Correct 265 ms 3188 KB Output is correct
38 Correct 338 ms 3140 KB Output is correct
39 Correct 338 ms 3268 KB Output is correct
40 Correct 348 ms 3320 KB Output is correct
41 Correct 335 ms 3188 KB Output is correct
42 Correct 328 ms 3212 KB Output is correct
43 Correct 322 ms 3276 KB Output is correct
44 Correct 334 ms 3272 KB Output is correct
45 Correct 428 ms 3348 KB Output is correct
46 Correct 524 ms 3412 KB Output is correct
47 Correct 538 ms 3384 KB Output is correct
48 Correct 531 ms 3492 KB Output is correct
49 Correct 533 ms 3556 KB Output is correct
50 Correct 539 ms 3516 KB Output is correct
51 Correct 558 ms 3384 KB Output is correct
52 Correct 559 ms 3540 KB Output is correct
53 Correct 530 ms 3608 KB Output is correct
54 Correct 550 ms 3472 KB Output is correct
55 Correct 542 ms 3404 KB Output is correct
56 Correct 525 ms 3320 KB Output is correct
57 Correct 673 ms 3780 KB Output is correct
58 Correct 789 ms 3884 KB Output is correct
59 Correct 817 ms 3928 KB Output is correct
60 Correct 807 ms 4148 KB Output is correct
61 Correct 803 ms 4076 KB Output is correct
62 Correct 812 ms 3920 KB Output is correct
63 Correct 809 ms 4076 KB Output is correct
64 Correct 794 ms 4140 KB Output is correct
65 Correct 800 ms 4080 KB Output is correct
66 Correct 788 ms 4000 KB Output is correct
67 Correct 766 ms 4048 KB Output is correct
68 Correct 779 ms 4012 KB Output is correct
69 Correct 970 ms 4132 KB Output is correct
70 Correct 1109 ms 4372 KB Output is correct
71 Correct 1128 ms 4248 KB Output is correct
72 Correct 1110 ms 4340 KB Output is correct
73 Correct 1149 ms 4396 KB Output is correct
74 Correct 1130 ms 4232 KB Output is correct
75 Correct 1133 ms 4256 KB Output is correct
76 Correct 1132 ms 4260 KB Output is correct
77 Correct 1209 ms 4408 KB Output is correct
78 Correct 1619 ms 4652 KB Output is correct
79 Correct 1573 ms 4648 KB Output is correct
80 Correct 1698 ms 4728 KB Output is correct
81 Correct 1733 ms 4704 KB Output is correct
82 Correct 1706 ms 4548 KB Output is correct
83 Correct 1664 ms 4504 KB Output is correct
84 Correct 1717 ms 4612 KB Output is correct