답안 #1092726

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1092726 2024-09-24T20:51:46 Z raphaelp Building Skyscrapers (CEOI19_skyscrapers) C++14
100 / 100
2184 ms 107928 KB
#include <bits/stdc++.h>
using namespace std;
void dfs(int x, vector<vector<int>> &AR, vector<int> &occ, int &nb)
{
    if (occ[x])
        return;
    nb--;
    occ[x] = 1;
    for (int i = 0; i < AR[x].size(); i++)
    {
        dfs(AR[x][i], AR, occ, nb);
    }
}
class UnionFind
{
private:
    vector<int> p;

public:
    UnionFind(int x)
    {
        p.assign(x, 0);
        for (int i = 0; i < x; i++)
            p[i] = i;
    }
    int find(int x) { return (p[x] == x) ? x : p[x] = find(p[x]); }
    void merge(int a, int b)
    {
        int x = find(a), y = find(b);
        if (x == y)
            return;
        p[x] = y;
    }
};
int main()
{
    int N, T;
    cin >> N >> T;
    map<pair<int, int>, int> M;
    vector<pair<int, int>> Tab;
    vector<vector<int>> AR, AR2;
    vector<pair<int, int>> trans1 = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}}, trans2 = {{-1, -1}, {-1, 0}, {-1, 1}, {0, -1}, {0, 1}, {1, -1}, {1, 0}, {1, 1}};
    int buff = 0;
    for (int i = 0; i < N; i++)
    {
        int x, y;
        cin >> x >> y;
        Tab.push_back({x, y});
        M[{x, y}] = buff++;
        AR.push_back({});
        AR2.push_back({});
        for (int j = 0; j < 4; j++)
            if (M.count({x + trans1[j].first, y + trans1[j].second}))
            {
                AR[i].push_back(M[{x + trans1[j].first, y + trans1[j].second}]);
                AR[M[{x + trans1[j].first, y + trans1[j].second}]].push_back(i);
            }
        for (int j = 0; j < 8; j++)
            if (M.count({x + trans2[j].first, y + trans2[j].second}))
            {
                AR2[i].push_back(M[{x + trans2[j].first, y + trans2[j].second}]);
                AR2[M[{x + trans2[j].first, y + trans2[j].second}]].push_back(i);
            }
    }
    vector<int> ans, occ(N);
    int nb = N;
    dfs(0, AR2, occ, nb);
    if (nb)
    {
        cout << "NO" << '\n';
        return 0;
    }
    pair<int, int> minn = {1000000010, 0};
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < 8; j++)
        {
            int x = Tab[i].first + trans2[j].first, y = Tab[i].second + trans2[j].second;
            if (M.count({x, y}) == 0)
            {
                M[{x, y}] = buff++;
                minn = min(minn, {x, y});
                Tab.push_back({x, y});
                AR.push_back({});
                AR2.push_back({});
                for (int k = 0; k < 4; k++)
                    if (M.count({x + trans1[k].first, y + trans1[k].second}))
                    {
                        AR[buff - 1].push_back(M[{x + trans1[k].first, y + trans1[k].second}]);
                        AR[M[{x + trans1[k].first, y + trans1[k].second}]].push_back(buff - 1);
                    }
            }
        }
    }
    UnionFind UF(buff);
    occ.assign(buff, 0);
    occ[M[minn]] = 1;
    queue<int> Q;
    Q.push(M[minn]);
    vector<int> done(N);
    priority_queue<int> next;
    for (int i = N; i < buff; i++)
    {
        for (int j = 0; j < AR[i].size(); j++)
        {
            if (AR[i][j] < N)
                continue;
            UF.merge(i, AR[i][j]);
        }
    }
    while (!Q.empty())
    {
        int x = Q.front();
        Q.pop();
        for (int i = 0; i < AR[x].size(); i++)
        {
            if (occ[AR[x][i]])
                continue;
            occ[AR[x][i]] = 1;
            if (AR[x][i] >= N)
                Q.push(AR[x][i]);
            else
                next.push(AR[x][i]);
        }
    }
    while (!next.empty())
    {
        int x = next.top();
        next.pop();
        if (done[x])
            continue;
        vector<int> count = {M[{Tab[x].first - 1, Tab[x].second - 1}], M[{Tab[x].first - 1, Tab[x].second}], M[{Tab[x].first - 1, Tab[x].second + 1}], M[{Tab[x].first, Tab[x].second + 1}], M[{Tab[x].first + 1, Tab[x].second + 1}], M[{Tab[x].first + 1, Tab[x].second}], M[{Tab[x].first + 1, Tab[x].second - 1}], M[{Tab[x].first, Tab[x].second - 1}]};
        for (int i = 0; i < 8; i++)
            count[i] = ((count[i] >= N || done[count[i]]) ? 0 : 1);
        int u = M[{Tab[x].first - 1, Tab[x].second}], d = M[{Tab[x].first + 1, Tab[x].second}], l = M[{Tab[x].first, Tab[x].second - 1}], r = M[{Tab[x].first, Tab[x].second + 1}];
        if ((u >= N || done[u]) && (d >= N || done[d]) && UF.find(u) == UF.find(d))
        {
            if (count[0] + count[6] + count[7] && count[2] + count[3] + count[4])
                continue;
        }
        if ((l >= N || done[l]) && (r >= N || done[r]) && UF.find(l) == UF.find(r))
        {
            if (count[0] + count[1] + count[2] && count[4] + count[5] + count[6])
                continue;
        }
        if ((u >= N || done[u]) && (l >= N || done[l]) && UF.find(u) == UF.find(l))
        {
            if (count[0] && count[2] + count[3] + count[4] + count[5] + count[6])
                continue;
        }
        if ((u >= N || done[u]) && (r >= N || done[r]) && UF.find(u) == UF.find(r))
        {
            if (count[0] + +count[4] + count[5] + count[6] + count[7] && count[2])
                continue;
        }
        if ((l >= N || done[l]) && (d >= N || done[d]) && UF.find(l) == UF.find(d))
        {
            if (count[0] + count[1] + count[2] + count[3] + count[4] && count[6])
                continue;
        }
        if ((r >= N || done[r]) && (d >= N || done[d]) && UF.find(r) == UF.find(d))
        {
            if (count[0] + count[6] + count[7] + count[1] + count[2] && count[4])
                continue;
        }

        ans.push_back(x);
        done[x] = 1;
        for (int i = 0; i < AR[x].size(); i++)
        {
            if (AR[x][i] >= N || done[AR[x][i]])
                UF.merge(x, AR[x][i]);
        }
        Q.push(x);
        while (!Q.empty())
        {
            int y = Q.front();
            Q.pop();
            for (int i = 0; i < AR[y].size(); i++)
            {
                if (occ[AR[y][i]])
                    continue;
                occ[AR[y][i]] = 1;
                if (AR[y][i] >= N)
                    Q.push(AR[y][i]);
                else
                    next.push(AR[y][i]);
            }
        }
        for (int i = 0; i < AR2[x].size(); i++)
        {
            if (AR2[x][i] >= N || done[AR2[x][i]] || occ[AR2[x][i]] == 0)
                continue;
            next.push(AR2[x][i]);
        }
    }
    cout << "YES" << '\n';
    for (int i = N - 1; i >= 0; i--)
    {
        cout << ans[i] + 1 << '\n';
    }
}

Compilation message

skyscrapers.cpp: In function 'void dfs(int, std::vector<std::vector<int> >&, std::vector<int>&, int&)':
skyscrapers.cpp:9:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     for (int i = 0; i < AR[x].size(); i++)
      |                     ~~^~~~~~~~~~~~~~
skyscrapers.cpp: In function 'int main()':
skyscrapers.cpp:104:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  104 |         for (int j = 0; j < AR[i].size(); j++)
      |                         ~~^~~~~~~~~~~~~~
skyscrapers.cpp:115:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  115 |         for (int i = 0; i < AR[x].size(); i++)
      |                         ~~^~~~~~~~~~~~~~
skyscrapers.cpp:169:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  169 |         for (int i = 0; i < AR[x].size(); i++)
      |                         ~~^~~~~~~~~~~~~~
skyscrapers.cpp:179:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  179 |             for (int i = 0; i < AR[y].size(); i++)
      |                             ~~^~~~~~~~~~~~~~
skyscrapers.cpp:190:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  190 |         for (int i = 0; i < AR2[x].size(); i++)
      |                         ~~^~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB ans=YES N=1
2 Correct 0 ms 348 KB ans=YES N=4
3 Correct 0 ms 348 KB ans=NO N=4
4 Correct 0 ms 348 KB ans=YES N=5
5 Correct 1 ms 348 KB ans=YES N=9
6 Correct 0 ms 432 KB ans=YES N=5
7 Correct 0 ms 348 KB ans=NO N=9
8 Correct 0 ms 348 KB ans=NO N=10
9 Correct 0 ms 348 KB ans=YES N=10
10 Correct 0 ms 348 KB ans=YES N=10
11 Correct 0 ms 348 KB ans=YES N=10
12 Correct 0 ms 348 KB ans=YES N=9
13 Correct 1 ms 348 KB ans=YES N=9
14 Correct 0 ms 348 KB ans=YES N=8
15 Correct 0 ms 348 KB ans=YES N=8
16 Correct 0 ms 348 KB ans=NO N=2
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB ans=YES N=1
2 Correct 0 ms 348 KB ans=YES N=4
3 Correct 0 ms 348 KB ans=NO N=4
4 Correct 0 ms 348 KB ans=YES N=5
5 Correct 1 ms 348 KB ans=YES N=9
6 Correct 0 ms 432 KB ans=YES N=5
7 Correct 0 ms 348 KB ans=NO N=9
8 Correct 0 ms 348 KB ans=NO N=10
9 Correct 0 ms 348 KB ans=YES N=10
10 Correct 0 ms 348 KB ans=YES N=10
11 Correct 0 ms 348 KB ans=YES N=10
12 Correct 0 ms 348 KB ans=YES N=9
13 Correct 1 ms 348 KB ans=YES N=9
14 Correct 0 ms 348 KB ans=YES N=8
15 Correct 0 ms 348 KB ans=YES N=8
16 Correct 0 ms 348 KB ans=NO N=2
17 Correct 1 ms 348 KB ans=YES N=17
18 Correct 0 ms 348 KB ans=YES N=25
19 Correct 1 ms 348 KB ans=YES N=100
20 Correct 1 ms 348 KB ans=YES N=185
21 Correct 0 ms 348 KB ans=NO N=174
22 Correct 1 ms 600 KB ans=YES N=90
23 Correct 1 ms 436 KB ans=YES N=63
24 Correct 1 ms 344 KB ans=YES N=87
25 Correct 1 ms 348 KB ans=YES N=183
26 Correct 1 ms 348 KB ans=YES N=188
27 Correct 1 ms 348 KB ans=YES N=183
28 Correct 1 ms 356 KB ans=YES N=189
29 Correct 2 ms 356 KB ans=YES N=200
30 Correct 1 ms 360 KB ans=YES N=190
31 Correct 1 ms 360 KB ans=YES N=187
32 Correct 1 ms 360 KB ans=YES N=187
33 Correct 1 ms 580 KB ans=YES N=182
34 Correct 2 ms 360 KB ans=YES N=184
35 Correct 2 ms 360 KB ans=YES N=188
36 Correct 1 ms 360 KB ans=YES N=181
37 Correct 1 ms 360 KB ans=YES N=188
38 Correct 2 ms 360 KB ans=YES N=191
39 Correct 1 ms 360 KB ans=YES N=196
40 Correct 1 ms 360 KB ans=YES N=196
41 Correct 1 ms 360 KB ans=YES N=196
42 Correct 1 ms 360 KB ans=YES N=196
43 Correct 2 ms 360 KB ans=YES N=195
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB ans=YES N=1
2 Correct 0 ms 348 KB ans=YES N=4
3 Correct 0 ms 348 KB ans=NO N=4
4 Correct 0 ms 348 KB ans=YES N=5
5 Correct 1 ms 348 KB ans=YES N=9
6 Correct 0 ms 432 KB ans=YES N=5
7 Correct 0 ms 348 KB ans=NO N=9
8 Correct 0 ms 348 KB ans=NO N=10
9 Correct 0 ms 348 KB ans=YES N=10
10 Correct 0 ms 348 KB ans=YES N=10
11 Correct 0 ms 348 KB ans=YES N=10
12 Correct 0 ms 348 KB ans=YES N=9
13 Correct 1 ms 348 KB ans=YES N=9
14 Correct 0 ms 348 KB ans=YES N=8
15 Correct 0 ms 348 KB ans=YES N=8
16 Correct 0 ms 348 KB ans=NO N=2
17 Correct 1 ms 348 KB ans=YES N=17
18 Correct 0 ms 348 KB ans=YES N=25
19 Correct 1 ms 348 KB ans=YES N=100
20 Correct 1 ms 348 KB ans=YES N=185
21 Correct 0 ms 348 KB ans=NO N=174
22 Correct 1 ms 600 KB ans=YES N=90
23 Correct 1 ms 436 KB ans=YES N=63
24 Correct 1 ms 344 KB ans=YES N=87
25 Correct 1 ms 348 KB ans=YES N=183
26 Correct 1 ms 348 KB ans=YES N=188
27 Correct 1 ms 348 KB ans=YES N=183
28 Correct 1 ms 356 KB ans=YES N=189
29 Correct 2 ms 356 KB ans=YES N=200
30 Correct 1 ms 360 KB ans=YES N=190
31 Correct 1 ms 360 KB ans=YES N=187
32 Correct 1 ms 360 KB ans=YES N=187
33 Correct 1 ms 580 KB ans=YES N=182
34 Correct 2 ms 360 KB ans=YES N=184
35 Correct 2 ms 360 KB ans=YES N=188
36 Correct 1 ms 360 KB ans=YES N=181
37 Correct 1 ms 360 KB ans=YES N=188
38 Correct 2 ms 360 KB ans=YES N=191
39 Correct 1 ms 360 KB ans=YES N=196
40 Correct 1 ms 360 KB ans=YES N=196
41 Correct 1 ms 360 KB ans=YES N=196
42 Correct 1 ms 360 KB ans=YES N=196
43 Correct 2 ms 360 KB ans=YES N=195
44 Correct 3 ms 616 KB ans=NO N=1934
45 Correct 3 ms 616 KB ans=NO N=1965
46 Correct 10 ms 872 KB ans=YES N=1824
47 Correct 11 ms 872 KB ans=YES N=1981
48 Correct 12 ms 856 KB ans=YES N=1814
49 Correct 11 ms 860 KB ans=YES N=1854
50 Correct 10 ms 860 KB ans=YES N=1831
51 Correct 11 ms 860 KB ans=YES N=2000
52 Correct 11 ms 1112 KB ans=YES N=1847
53 Correct 12 ms 1116 KB ans=YES N=1819
54 Correct 11 ms 860 KB ans=YES N=1986
55 Correct 15 ms 1416 KB ans=YES N=2000
56 Correct 14 ms 1368 KB ans=YES N=1834
57 Correct 14 ms 1372 KB ans=YES N=1860
58 Correct 16 ms 1372 KB ans=YES N=1898
59 Correct 14 ms 1372 KB ans=YES N=1832
60 Correct 16 ms 1728 KB ans=YES N=1929
61 Correct 12 ms 1116 KB ans=YES N=1919
62 Correct 14 ms 1372 KB ans=YES N=1882
63 Correct 16 ms 1624 KB ans=YES N=1922
64 Correct 12 ms 1116 KB ans=YES N=1989
65 Correct 12 ms 1368 KB ans=YES N=1978
66 Correct 12 ms 1372 KB ans=YES N=1867
67 Correct 14 ms 1372 KB ans=YES N=1942
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 588 KB ans=NO N=1934
2 Correct 4 ms 604 KB ans=NO N=1965
3 Correct 9 ms 860 KB ans=YES N=1824
4 Correct 11 ms 860 KB ans=YES N=1981
5 Correct 11 ms 860 KB ans=YES N=1814
6 Correct 11 ms 860 KB ans=YES N=1854
7 Correct 10 ms 860 KB ans=YES N=1831
8 Correct 12 ms 860 KB ans=YES N=2000
9 Correct 11 ms 1116 KB ans=YES N=1847
10 Correct 15 ms 1112 KB ans=YES N=1819
11 Correct 12 ms 860 KB ans=YES N=1986
12 Correct 14 ms 1368 KB ans=YES N=2000
13 Correct 14 ms 1368 KB ans=YES N=1834
14 Correct 15 ms 1368 KB ans=YES N=1860
15 Correct 16 ms 1368 KB ans=YES N=1898
16 Correct 14 ms 1468 KB ans=YES N=1832
17 Correct 16 ms 1628 KB ans=YES N=1929
18 Correct 11 ms 1112 KB ans=YES N=1919
19 Correct 14 ms 1360 KB ans=YES N=1882
20 Correct 16 ms 1624 KB ans=YES N=1922
21 Correct 12 ms 1116 KB ans=YES N=1989
22 Correct 11 ms 1372 KB ans=YES N=1978
23 Correct 12 ms 1368 KB ans=YES N=1867
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB ans=YES N=1
2 Correct 0 ms 348 KB ans=YES N=4
3 Correct 0 ms 348 KB ans=NO N=4
4 Correct 0 ms 348 KB ans=YES N=5
5 Correct 1 ms 348 KB ans=YES N=9
6 Correct 0 ms 432 KB ans=YES N=5
7 Correct 0 ms 348 KB ans=NO N=9
8 Correct 0 ms 348 KB ans=NO N=10
9 Correct 0 ms 348 KB ans=YES N=10
10 Correct 0 ms 348 KB ans=YES N=10
11 Correct 0 ms 348 KB ans=YES N=10
12 Correct 0 ms 348 KB ans=YES N=9
13 Correct 1 ms 348 KB ans=YES N=9
14 Correct 0 ms 348 KB ans=YES N=8
15 Correct 0 ms 348 KB ans=YES N=8
16 Correct 0 ms 348 KB ans=NO N=2
17 Correct 1 ms 348 KB ans=YES N=17
18 Correct 0 ms 348 KB ans=YES N=25
19 Correct 1 ms 348 KB ans=YES N=100
20 Correct 1 ms 348 KB ans=YES N=185
21 Correct 0 ms 348 KB ans=NO N=174
22 Correct 1 ms 600 KB ans=YES N=90
23 Correct 1 ms 436 KB ans=YES N=63
24 Correct 1 ms 344 KB ans=YES N=87
25 Correct 1 ms 348 KB ans=YES N=183
26 Correct 1 ms 348 KB ans=YES N=188
27 Correct 1 ms 348 KB ans=YES N=183
28 Correct 1 ms 356 KB ans=YES N=189
29 Correct 2 ms 356 KB ans=YES N=200
30 Correct 1 ms 360 KB ans=YES N=190
31 Correct 1 ms 360 KB ans=YES N=187
32 Correct 1 ms 360 KB ans=YES N=187
33 Correct 1 ms 580 KB ans=YES N=182
34 Correct 2 ms 360 KB ans=YES N=184
35 Correct 2 ms 360 KB ans=YES N=188
36 Correct 1 ms 360 KB ans=YES N=181
37 Correct 1 ms 360 KB ans=YES N=188
38 Correct 2 ms 360 KB ans=YES N=191
39 Correct 1 ms 360 KB ans=YES N=196
40 Correct 1 ms 360 KB ans=YES N=196
41 Correct 1 ms 360 KB ans=YES N=196
42 Correct 1 ms 360 KB ans=YES N=196
43 Correct 2 ms 360 KB ans=YES N=195
44 Correct 3 ms 616 KB ans=NO N=1934
45 Correct 3 ms 616 KB ans=NO N=1965
46 Correct 10 ms 872 KB ans=YES N=1824
47 Correct 11 ms 872 KB ans=YES N=1981
48 Correct 12 ms 856 KB ans=YES N=1814
49 Correct 11 ms 860 KB ans=YES N=1854
50 Correct 10 ms 860 KB ans=YES N=1831
51 Correct 11 ms 860 KB ans=YES N=2000
52 Correct 11 ms 1112 KB ans=YES N=1847
53 Correct 12 ms 1116 KB ans=YES N=1819
54 Correct 11 ms 860 KB ans=YES N=1986
55 Correct 15 ms 1416 KB ans=YES N=2000
56 Correct 14 ms 1368 KB ans=YES N=1834
57 Correct 14 ms 1372 KB ans=YES N=1860
58 Correct 16 ms 1372 KB ans=YES N=1898
59 Correct 14 ms 1372 KB ans=YES N=1832
60 Correct 16 ms 1728 KB ans=YES N=1929
61 Correct 12 ms 1116 KB ans=YES N=1919
62 Correct 14 ms 1372 KB ans=YES N=1882
63 Correct 16 ms 1624 KB ans=YES N=1922
64 Correct 12 ms 1116 KB ans=YES N=1989
65 Correct 12 ms 1368 KB ans=YES N=1978
66 Correct 12 ms 1372 KB ans=YES N=1867
67 Correct 14 ms 1372 KB ans=YES N=1942
68 Correct 193 ms 14736 KB ans=NO N=66151
69 Correct 114 ms 10036 KB ans=NO N=64333
70 Correct 527 ms 19024 KB ans=YES N=69316
71 Correct 522 ms 18420 KB ans=YES N=66695
72 Correct 520 ms 18976 KB ans=YES N=68436
73 Correct 536 ms 19484 KB ans=YES N=70000
74 Correct 520 ms 19368 KB ans=YES N=68501
75 Correct 534 ms 20048 KB ans=YES N=70000
76 Correct 519 ms 20260 KB ans=YES N=65009
77 Correct 688 ms 30468 KB ans=YES N=67007
78 Correct 718 ms 34824 KB ans=YES N=66357
79 Correct 741 ms 38624 KB ans=YES N=65430
80 Correct 730 ms 36916 KB ans=YES N=65790
81 Correct 708 ms 34476 KB ans=YES N=66020
82 Correct 702 ms 32516 KB ans=YES N=65809
83 Correct 592 ms 23412 KB ans=YES N=65651
84 Correct 871 ms 49152 KB ans=YES N=68040
85 Correct 789 ms 42160 KB ans=YES N=66570
86 Correct 533 ms 19216 KB ans=YES N=65421
87 Correct 581 ms 20564 KB ans=YES N=68351
88 Correct 505 ms 18464 KB ans=YES N=67027
89 Correct 568 ms 28680 KB ans=YES N=68879
90 Correct 551 ms 20960 KB ans=YES N=67256
91 Correct 1374 ms 41780 KB ans=YES N=148315
92 Correct 273 ms 21532 KB ans=NO N=142745
93 Correct 257 ms 21752 KB ans=NO N=148443
94 Correct 1459 ms 41988 KB ans=YES N=148328
95 Correct 1629 ms 42120 KB ans=YES N=147855
96 Correct 1436 ms 42756 KB ans=YES N=150000
97 Correct 1279 ms 41220 KB ans=YES N=144725
98 Correct 1332 ms 42712 KB ans=YES N=149445
99 Correct 1312 ms 41740 KB ans=YES N=144455
100 Correct 1259 ms 41180 KB ans=YES N=143487
101 Correct 1349 ms 43012 KB ans=YES N=149688
102 Correct 1810 ms 67896 KB ans=YES N=141481
103 Correct 2079 ms 96220 KB ans=YES N=147430
104 Correct 1559 ms 54788 KB ans=YES N=142247
105 Correct 1824 ms 65508 KB ans=YES N=149941
106 Correct 1907 ms 90076 KB ans=YES N=141635
107 Correct 1951 ms 80860 KB ans=YES N=142896
108 Correct 2059 ms 90596 KB ans=YES N=142069
109 Correct 1381 ms 46336 KB ans=YES N=142378
110 Correct 1761 ms 73692 KB ans=YES N=150000
111 Correct 2135 ms 105112 KB ans=YES N=141452
112 Correct 1932 ms 100508 KB ans=YES N=134453
113 Correct 1763 ms 107784 KB ans=YES N=144172
# 결과 실행 시간 메모리 Grader output
1 Correct 194 ms 14844 KB ans=NO N=66151
2 Correct 120 ms 9980 KB ans=NO N=64333
3 Correct 519 ms 18968 KB ans=YES N=69316
4 Correct 487 ms 18468 KB ans=YES N=66695
5 Correct 511 ms 19044 KB ans=YES N=68436
6 Correct 541 ms 19580 KB ans=YES N=70000
7 Correct 526 ms 19336 KB ans=YES N=68501
8 Correct 558 ms 20124 KB ans=YES N=70000
9 Correct 535 ms 20256 KB ans=YES N=65009
10 Correct 693 ms 30472 KB ans=YES N=67007
11 Correct 689 ms 34820 KB ans=YES N=66357
12 Correct 746 ms 38672 KB ans=YES N=65430
13 Correct 725 ms 37164 KB ans=YES N=65790
14 Correct 724 ms 34568 KB ans=YES N=66020
15 Correct 676 ms 32516 KB ans=YES N=65809
16 Correct 574 ms 23492 KB ans=YES N=65651
17 Correct 862 ms 49028 KB ans=YES N=68040
18 Correct 771 ms 42344 KB ans=YES N=66570
19 Correct 517 ms 19308 KB ans=YES N=65421
20 Correct 565 ms 20772 KB ans=YES N=68351
21 Correct 507 ms 18468 KB ans=YES N=67027
22 Correct 542 ms 28680 KB ans=YES N=68879
23 Correct 538 ms 21024 KB ans=YES N=67256
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 588 KB ans=NO N=1934
2 Correct 4 ms 604 KB ans=NO N=1965
3 Correct 9 ms 860 KB ans=YES N=1824
4 Correct 11 ms 860 KB ans=YES N=1981
5 Correct 11 ms 860 KB ans=YES N=1814
6 Correct 11 ms 860 KB ans=YES N=1854
7 Correct 10 ms 860 KB ans=YES N=1831
8 Correct 12 ms 860 KB ans=YES N=2000
9 Correct 11 ms 1116 KB ans=YES N=1847
10 Correct 15 ms 1112 KB ans=YES N=1819
11 Correct 12 ms 860 KB ans=YES N=1986
12 Correct 14 ms 1368 KB ans=YES N=2000
13 Correct 14 ms 1368 KB ans=YES N=1834
14 Correct 15 ms 1368 KB ans=YES N=1860
15 Correct 16 ms 1368 KB ans=YES N=1898
16 Correct 14 ms 1468 KB ans=YES N=1832
17 Correct 16 ms 1628 KB ans=YES N=1929
18 Correct 11 ms 1112 KB ans=YES N=1919
19 Correct 14 ms 1360 KB ans=YES N=1882
20 Correct 16 ms 1624 KB ans=YES N=1922
21 Correct 12 ms 1116 KB ans=YES N=1989
22 Correct 11 ms 1372 KB ans=YES N=1978
23 Correct 12 ms 1368 KB ans=YES N=1867
24 Correct 194 ms 14844 KB ans=NO N=66151
25 Correct 120 ms 9980 KB ans=NO N=64333
26 Correct 519 ms 18968 KB ans=YES N=69316
27 Correct 487 ms 18468 KB ans=YES N=66695
28 Correct 511 ms 19044 KB ans=YES N=68436
29 Correct 541 ms 19580 KB ans=YES N=70000
30 Correct 526 ms 19336 KB ans=YES N=68501
31 Correct 558 ms 20124 KB ans=YES N=70000
32 Correct 535 ms 20256 KB ans=YES N=65009
33 Correct 693 ms 30472 KB ans=YES N=67007
34 Correct 689 ms 34820 KB ans=YES N=66357
35 Correct 746 ms 38672 KB ans=YES N=65430
36 Correct 725 ms 37164 KB ans=YES N=65790
37 Correct 724 ms 34568 KB ans=YES N=66020
38 Correct 676 ms 32516 KB ans=YES N=65809
39 Correct 574 ms 23492 KB ans=YES N=65651
40 Correct 862 ms 49028 KB ans=YES N=68040
41 Correct 771 ms 42344 KB ans=YES N=66570
42 Correct 517 ms 19308 KB ans=YES N=65421
43 Correct 565 ms 20772 KB ans=YES N=68351
44 Correct 507 ms 18468 KB ans=YES N=67027
45 Correct 542 ms 28680 KB ans=YES N=68879
46 Correct 538 ms 21024 KB ans=YES N=67256
47 Correct 1361 ms 41772 KB ans=YES N=148315
48 Correct 252 ms 21524 KB ans=NO N=142745
49 Correct 239 ms 21524 KB ans=NO N=148443
50 Correct 1286 ms 41864 KB ans=YES N=148328
51 Correct 1386 ms 42120 KB ans=YES N=147855
52 Correct 1344 ms 42760 KB ans=YES N=150000
53 Correct 1307 ms 41312 KB ans=YES N=144725
54 Correct 1346 ms 42652 KB ans=YES N=149445
55 Correct 1319 ms 41648 KB ans=YES N=144455
56 Correct 1292 ms 41228 KB ans=YES N=143487
57 Correct 1358 ms 42992 KB ans=YES N=149688
58 Correct 1808 ms 67904 KB ans=YES N=141481
59 Correct 2169 ms 96124 KB ans=YES N=147430
60 Correct 1643 ms 54656 KB ans=YES N=142247
61 Correct 1793 ms 65508 KB ans=YES N=149941
62 Correct 1939 ms 90080 KB ans=YES N=141635
63 Correct 2065 ms 81080 KB ans=YES N=142896
64 Correct 2164 ms 90612 KB ans=YES N=142069
65 Correct 1413 ms 46412 KB ans=YES N=142378
66 Correct 1862 ms 73904 KB ans=YES N=150000
67 Correct 2184 ms 105140 KB ans=YES N=141452
68 Correct 1939 ms 100504 KB ans=YES N=134453
69 Correct 1738 ms 107928 KB ans=YES N=144172