답안 #697164

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
697164 2023-02-08T17:03:47 Z whqkrtk04 벽 칠하기 (APIO20_paint) C++17
28 / 100
1500 ms 88564 KB
#include "paint.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<ll, ll> pll;
typedef pair<ll, pll> plll;
#define fi first
#define se second
const int INF = 1e9+1;
const int P = 1000000007;
const ll LLINF = (ll)1e18+1;
template <typename T1, typename T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& p) { os << p.fi << " " << p.se; return os; }
template <typename T>
ostream& operator<<(ostream& os, const deque<T>& v) { for(auto i : v) os << i << " "; os << "\n"; return os; }
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) { for(auto i : v) os << i << " "; os << "\n"; return os; }

vector<int> evaluate(int M, deque<int> &chk, vector<int> &can) {
    vector<int> ret;
    if(chk.size() > can.size()) return ret;
    for(int i = 0; i < can.size(); i++) {
        int diff = ((can[i]-chk[0])%M+M)%M;
        bool valid = true;
        for(int j = 0; j < chk.size(); j++) {
            int tmp = ((chk[j]+diff)%M+M)%M;
            auto iter = lower_bound(can.begin(), can.end(), tmp);
            if(iter == can.end() || *iter != tmp) valid = false;
        }
        if(valid) ret.push_back(diff);
    }
    return ret;
}

template <typename node_seg, typename node_query = node_seg, typename index_t = int>
class Segtree {
	private:
	const size_t n;
	std::vector<node_seg> seg;

	void init(const size_t i, const index_t s, const index_t e, const std::vector<node_seg> &A) {
		if(s+1 == e) seg[i] = A[s];
		else {
			init(i<<1, s, s+e>>1, A);
			init(i<<1|1, s+e>>1, e, A);
			seg[i] = seg[i<<1]+seg[i<<1|1];
		}
	}

	void update(const size_t i, const index_t s, const index_t e, const index_t j, const node_query &x) {
		if(j >= e || s > j) return;
		if(s+1 == e) seg[i] += x;
		else {
			update(i<<1, s, s+e>>1, j, x);
			update(i<<1|1, s+e>>1, e, j, x);
			seg[i] = seg[i<<1]+seg[i<<1|1];
		}
	}

	node_seg query(const size_t i, const index_t s, const index_t e, const index_t l, const index_t r) const {
		if(e <= l || r <= s) return node_seg::inf();
		if(l <= s && e <= r) return seg[i];
		return query(i<<1, s, s+e>>1, l, r)+query(i<<1|1, s+e>>1, e, l, r);
	}

	public:
	Segtree(const int n) : n(n) {
		seg.resize(4*n, node_seg::inf());
	}
	Segtree(const std::vector<node_seg> &A) : n(A.size()) {
		seg.resize(4*n, node_seg::inf());
		init(1, 0, n, A);
	}
	void update(const index_t j, const node_query &x) { update(1, 0, n, j, x); }
	node_seg query(const index_t l, const index_t r) const { return query(1, 0, n, l, r); }
};

struct min_node {
    int x;
    static min_node inf() { return {INF}; }
    min_node operator+(const min_node &y) { return {min(x, y.x)}; }
    void operator+=(const min_node &y) { x = min(x, y.x); }
};

void add(int M, int idx, int &uniqcnt, int &macnt,
        vector<int> &verdict, vector<int> &cnt, deque<int> &chk, vector<int> &can) {
    if(chk.empty()) uniqcnt++, macnt = 0;
    else for(auto j : verdict) if(cnt[j]-- == uniqcnt) macnt--;
    chk.push_back(idx);
    verdict = evaluate(M, chk, can);
    for(auto j : verdict) if(++cnt[j] == uniqcnt) macnt++;
}

void sub(int M, int &uniqcnt, int &macnt,
        vector<int> &verdict, vector<int> &cnt, deque<int> &chk, vector<int> &can) {
    for(auto j : verdict) if(cnt[j]-- == uniqcnt) macnt--;
    chk.pop_front();
    if(chk.empty()) uniqcnt--, verdict.clear();
    else verdict = evaluate(M, chk, can);
    for(auto j : verdict) if(++cnt[j] == uniqcnt) macnt++;
}

vector<bool> solve(int N, int M, int K, vector<int> C, vector<int> A, vector<vector<int>> B) {
    vector<deque<int>> chk(K);
    vector<vector<int>> verdict(K), can(K);
    vector<int> cnt(M, 0);
    vector<bool> can_paint(N, false);
    int macnt = 0, uniqcnt = 0;
    for(int i = 0; i < M; i++) for(auto j : B[i]) can[j].push_back(i);
    for(int i = 0; i < M; i++) {
        if(chk[C[i]].empty()) uniqcnt++, macnt = 0;
        else for(auto j : verdict[C[i]]) if(cnt[j]-- == uniqcnt) macnt--;
        chk[C[i]].push_back(i);
        verdict[C[i]] = evaluate(M, chk[C[i]], can[C[i]]);
        for(auto j : verdict[C[i]]) if(++cnt[j] == uniqcnt) macnt++;
        //cout << "print : " << i << "\n " << verdict;
    }
    can_paint[M-1] = macnt > 0;
    for(int i = M; i < N; i++) {
        if(chk[C[i]].empty()) uniqcnt++, macnt = 0;
        else for(auto j : verdict[C[i]]) if(cnt[j]-- == uniqcnt) macnt--;
        chk[C[i]].push_back(i);
        verdict[C[i]] = evaluate(M, chk[C[i]], can[C[i]]);
        for(auto j : verdict[C[i]]) if(++cnt[j] == uniqcnt) macnt++;

        for(auto j : verdict[C[i-M]]) if(cnt[j]-- == uniqcnt) macnt--;
        chk[C[i-M]].pop_front();
        if(chk[C[i-M]].empty()) uniqcnt--, verdict[C[i-M]].clear();
        else verdict[C[i-M]] = evaluate(M, chk[C[i-M]], can[C[i-M]]);
        for(auto j : verdict[C[i-M]]) if(++cnt[j] == uniqcnt) macnt++;

        macnt = 0;
        for(int i = 0; i < M; i++)
            if(cnt[i] == uniqcnt) macnt++;
        can_paint[i] = macnt > 0;
        //cout << "print : " << i << " " << macnt << " " << uniqcnt << "\n" << cnt << " " << verdict;
    }
    return can_paint;
}

int minimumInstructions(int N, int M, int K, vector<int> C, vector<int> A, vector<vector<int>> B) {
    vector<bool> can_paint = solve(N, M, K, C, A, B);
    //cout << can_paint;
    Segtree<min_node> dp(vector<min_node>(N, min_node::inf()));
    if(can_paint[M-1]) dp.update(M-1, {1});
    for(int i = M; i < N; i++) {
        if(can_paint[i]) {
            int tmp = dp.query(i-M, i).x;
            dp.update(i, {++tmp});
        }
    }
    int ans = dp.query(N-1, N).x;
    if(ans == INF) return -1;
    else return ans;
}

Compilation message

paint.cpp: In function 'std::vector<int> evaluate(int, std::deque<int>&, std::vector<int>&)':
paint.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 < can.size(); i++) {
      |                    ~~^~~~~~~~~~~~
paint.cpp:27:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::deque<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |         for(int j = 0; j < chk.size(); j++) {
      |                        ~~^~~~~~~~~~~~
paint.cpp: In instantiation of 'void Segtree<node_seg, node_query, index_t>::init(size_t, index_t, index_t, const std::vector<_Tp>&) [with node_seg = min_node; node_query = min_node; index_t = int; size_t = long unsigned int]':
paint.cpp:74:3:   required from 'Segtree<node_seg, node_query, index_t>::Segtree(const std::vector<_Tp>&) [with node_seg = min_node; node_query = min_node; index_t = int]'
paint.cpp:146:62:   required from here
paint.cpp:46:19: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   46 |    init(i<<1, s, s+e>>1, A);
      |                  ~^~
paint.cpp:47:18: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   47 |    init(i<<1|1, s+e>>1, e, A);
      |                 ~^~
paint.cpp: In instantiation of 'void Segtree<node_seg, node_query, index_t>::update(size_t, index_t, index_t, index_t, const node_query&) [with node_seg = min_node; node_query = min_node; index_t = int; size_t = long unsigned int]':
paint.cpp:76:60:   required from 'void Segtree<node_seg, node_query, index_t>::update(index_t, const node_query&) [with node_seg = min_node; node_query = min_node; index_t = int]'
paint.cpp:147:42:   required from here
paint.cpp:56:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   56 |    update(i<<1, s, s+e>>1, j, x);
      |                    ~^~
paint.cpp:57:20: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   57 |    update(i<<1|1, s+e>>1, e, j, x);
      |                   ~^~
paint.cpp: In instantiation of 'node_seg Segtree<node_seg, node_query, index_t>::query(size_t, index_t, index_t, index_t, index_t) const [with node_seg = min_node; node_query = min_node; index_t = int; size_t = long unsigned int]':
paint.cpp:77:71:   required from 'node_seg Segtree<node_seg, node_query, index_t>::query(index_t, index_t) const [with node_seg = min_node; node_query = min_node; index_t = int]'
paint.cpp:150:38:   required from here
paint.cpp:65:26: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   65 |   return query(i<<1, s, s+e>>1, l, r)+query(i<<1|1, s+e>>1, e, l, r);
      |                         ~^~
paint.cpp:65:54: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   65 |   return query(i<<1, s, s+e>>1, l, r)+query(i<<1|1, s+e>>1, e, l, r);
      |                                                     ~^~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 43 ms 72268 KB Output is correct
14 Correct 42 ms 72276 KB Output is correct
15 Correct 44 ms 72376 KB Output is correct
16 Correct 51 ms 72360 KB Output is correct
17 Correct 44 ms 72328 KB Output is correct
18 Correct 42 ms 72340 KB Output is correct
19 Correct 41 ms 72336 KB Output is correct
20 Correct 41 ms 72372 KB Output is correct
21 Correct 40 ms 72404 KB Output is correct
22 Correct 58 ms 76620 KB Output is correct
23 Correct 68 ms 76544 KB Output is correct
24 Correct 71 ms 76552 KB Output is correct
25 Correct 7 ms 852 KB Output is correct
26 Correct 6 ms 852 KB Output is correct
27 Correct 5 ms 852 KB Output is correct
28 Correct 7 ms 788 KB Output is correct
29 Correct 5 ms 852 KB Output is correct
30 Correct 4 ms 852 KB Output is correct
31 Correct 85 ms 74136 KB Output is correct
32 Correct 86 ms 74184 KB Output is correct
33 Correct 86 ms 74148 KB Output is correct
34 Correct 83 ms 74224 KB Output is correct
35 Correct 84 ms 74244 KB Output is correct
36 Correct 86 ms 74208 KB Output is correct
37 Correct 99 ms 77656 KB Output is correct
38 Correct 99 ms 77648 KB Output is correct
39 Correct 92 ms 77560 KB Output is correct
40 Correct 39 ms 2800 KB Output is correct
41 Correct 18 ms 1884 KB Output is correct
42 Correct 26 ms 3020 KB Output is correct
43 Correct 14 ms 2004 KB Output is correct
44 Correct 11 ms 1896 KB Output is correct
45 Correct 17 ms 3020 KB Output is correct
46 Correct 1328 ms 86816 KB Output is correct
47 Correct 591 ms 73548 KB Output is correct
48 Correct 390 ms 71728 KB Output is correct
49 Correct 676 ms 72500 KB Output is correct
50 Correct 922 ms 74044 KB Output is correct
51 Correct 836 ms 59468 KB Output is correct
52 Correct 33 ms 3060 KB Output is correct
53 Correct 43 ms 3024 KB Output is correct
54 Correct 26 ms 3020 KB Output is correct
55 Correct 19 ms 3020 KB Output is correct
56 Correct 18 ms 3008 KB Output is correct
57 Correct 17 ms 3020 KB Output is correct
58 Execution timed out 1581 ms 88564 KB Time limit exceeded
59 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 43 ms 72268 KB Output is correct
14 Correct 42 ms 72276 KB Output is correct
15 Correct 44 ms 72376 KB Output is correct
16 Correct 51 ms 72360 KB Output is correct
17 Correct 44 ms 72328 KB Output is correct
18 Correct 42 ms 72340 KB Output is correct
19 Correct 41 ms 72336 KB Output is correct
20 Correct 41 ms 72372 KB Output is correct
21 Correct 40 ms 72404 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 4 ms 212 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 3 ms 212 KB Output is correct
31 Correct 1 ms 212 KB Output is correct
32 Correct 2 ms 212 KB Output is correct
33 Correct 37 ms 61908 KB Output is correct
34 Correct 27 ms 46296 KB Output is correct
35 Correct 23 ms 40580 KB Output is correct
36 Correct 40 ms 70900 KB Output is correct
37 Correct 32 ms 57372 KB Output is correct
38 Correct 36 ms 63444 KB Output is correct
39 Correct 1 ms 468 KB Output is correct
40 Correct 31 ms 54536 KB Output is correct
41 Correct 1 ms 468 KB Output is correct
42 Correct 37 ms 68388 KB Output is correct
43 Correct 38 ms 66536 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 6 ms 304 KB Output is correct
46 Correct 5 ms 312 KB Output is correct
47 Correct 4 ms 212 KB Output is correct
48 Correct 3 ms 212 KB Output is correct
49 Correct 2 ms 212 KB Output is correct
50 Correct 41 ms 72368 KB Output is correct
51 Correct 41 ms 72328 KB Output is correct
52 Correct 41 ms 72268 KB Output is correct
53 Correct 42 ms 72348 KB Output is correct
54 Correct 42 ms 72372 KB Output is correct
55 Correct 41 ms 72328 KB Output is correct
56 Correct 41 ms 72328 KB Output is correct
57 Correct 1 ms 596 KB Output is correct
58 Correct 44 ms 72372 KB Output is correct
59 Correct 1 ms 596 KB Output is correct
60 Correct 42 ms 72312 KB Output is correct
61 Correct 1 ms 596 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 43 ms 72268 KB Output is correct
16 Correct 42 ms 72276 KB Output is correct
17 Correct 44 ms 72376 KB Output is correct
18 Correct 51 ms 72360 KB Output is correct
19 Correct 44 ms 72328 KB Output is correct
20 Correct 42 ms 72340 KB Output is correct
21 Correct 41 ms 72336 KB Output is correct
22 Correct 41 ms 72372 KB Output is correct
23 Correct 40 ms 72404 KB Output is correct
24 Correct 58 ms 76620 KB Output is correct
25 Correct 68 ms 76544 KB Output is correct
26 Correct 71 ms 76552 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 0 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 4 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 3 ms 212 KB Output is correct
34 Correct 1 ms 212 KB Output is correct
35 Correct 2 ms 212 KB Output is correct
36 Correct 37 ms 61908 KB Output is correct
37 Correct 27 ms 46296 KB Output is correct
38 Correct 23 ms 40580 KB Output is correct
39 Correct 40 ms 70900 KB Output is correct
40 Correct 32 ms 57372 KB Output is correct
41 Correct 36 ms 63444 KB Output is correct
42 Correct 1 ms 468 KB Output is correct
43 Correct 31 ms 54536 KB Output is correct
44 Correct 1 ms 468 KB Output is correct
45 Correct 37 ms 68388 KB Output is correct
46 Correct 38 ms 66536 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 6 ms 304 KB Output is correct
49 Correct 5 ms 312 KB Output is correct
50 Correct 4 ms 212 KB Output is correct
51 Correct 3 ms 212 KB Output is correct
52 Correct 2 ms 212 KB Output is correct
53 Correct 41 ms 72368 KB Output is correct
54 Correct 41 ms 72328 KB Output is correct
55 Correct 41 ms 72268 KB Output is correct
56 Correct 42 ms 72348 KB Output is correct
57 Correct 42 ms 72372 KB Output is correct
58 Correct 41 ms 72328 KB Output is correct
59 Correct 41 ms 72328 KB Output is correct
60 Correct 1 ms 596 KB Output is correct
61 Correct 44 ms 72372 KB Output is correct
62 Correct 1 ms 596 KB Output is correct
63 Correct 42 ms 72312 KB Output is correct
64 Correct 1 ms 596 KB Output is correct
65 Correct 63 ms 212 KB Output is correct
66 Correct 18 ms 212 KB Output is correct
67 Correct 119 ms 312 KB Output is correct
68 Correct 35 ms 212 KB Output is correct
69 Correct 69 ms 212 KB Output is correct
70 Correct 36 ms 61524 KB Output is correct
71 Correct 30 ms 50676 KB Output is correct
72 Correct 25 ms 43992 KB Output is correct
73 Correct 31 ms 51020 KB Output is correct
74 Correct 33 ms 57836 KB Output is correct
75 Correct 48 ms 71500 KB Output is correct
76 Correct 50 ms 53560 KB Output is correct
77 Correct 50 ms 65964 KB Output is correct
78 Correct 63 ms 73780 KB Output is correct
79 Correct 184 ms 340 KB Output is correct
80 Correct 395 ms 460 KB Output is correct
81 Correct 292 ms 340 KB Output is correct
82 Correct 240 ms 340 KB Output is correct
83 Correct 194 ms 344 KB Output is correct
84 Correct 42 ms 72584 KB Output is correct
85 Correct 43 ms 72664 KB Output is correct
86 Correct 41 ms 72620 KB Output is correct
87 Correct 44 ms 72572 KB Output is correct
88 Correct 42 ms 72632 KB Output is correct
89 Correct 46 ms 72692 KB Output is correct
90 Correct 65 ms 76604 KB Output is correct
91 Correct 68 ms 76620 KB Output is correct
92 Correct 65 ms 76644 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 43 ms 72268 KB Output is correct
16 Correct 42 ms 72276 KB Output is correct
17 Correct 44 ms 72376 KB Output is correct
18 Correct 51 ms 72360 KB Output is correct
19 Correct 44 ms 72328 KB Output is correct
20 Correct 42 ms 72340 KB Output is correct
21 Correct 41 ms 72336 KB Output is correct
22 Correct 41 ms 72372 KB Output is correct
23 Correct 40 ms 72404 KB Output is correct
24 Correct 58 ms 76620 KB Output is correct
25 Correct 68 ms 76544 KB Output is correct
26 Correct 71 ms 76552 KB Output is correct
27 Correct 7 ms 852 KB Output is correct
28 Correct 6 ms 852 KB Output is correct
29 Correct 5 ms 852 KB Output is correct
30 Correct 7 ms 788 KB Output is correct
31 Correct 5 ms 852 KB Output is correct
32 Correct 4 ms 852 KB Output is correct
33 Correct 85 ms 74136 KB Output is correct
34 Correct 86 ms 74184 KB Output is correct
35 Correct 86 ms 74148 KB Output is correct
36 Correct 83 ms 74224 KB Output is correct
37 Correct 84 ms 74244 KB Output is correct
38 Correct 86 ms 74208 KB Output is correct
39 Correct 99 ms 77656 KB Output is correct
40 Correct 99 ms 77648 KB Output is correct
41 Correct 92 ms 77560 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 0 ms 212 KB Output is correct
44 Correct 0 ms 212 KB Output is correct
45 Correct 1 ms 212 KB Output is correct
46 Correct 4 ms 212 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 3 ms 212 KB Output is correct
49 Correct 1 ms 212 KB Output is correct
50 Correct 2 ms 212 KB Output is correct
51 Correct 37 ms 61908 KB Output is correct
52 Correct 27 ms 46296 KB Output is correct
53 Correct 23 ms 40580 KB Output is correct
54 Correct 40 ms 70900 KB Output is correct
55 Correct 32 ms 57372 KB Output is correct
56 Correct 36 ms 63444 KB Output is correct
57 Correct 1 ms 468 KB Output is correct
58 Correct 31 ms 54536 KB Output is correct
59 Correct 1 ms 468 KB Output is correct
60 Correct 37 ms 68388 KB Output is correct
61 Correct 38 ms 66536 KB Output is correct
62 Correct 1 ms 212 KB Output is correct
63 Correct 6 ms 304 KB Output is correct
64 Correct 5 ms 312 KB Output is correct
65 Correct 4 ms 212 KB Output is correct
66 Correct 3 ms 212 KB Output is correct
67 Correct 2 ms 212 KB Output is correct
68 Correct 41 ms 72368 KB Output is correct
69 Correct 41 ms 72328 KB Output is correct
70 Correct 41 ms 72268 KB Output is correct
71 Correct 42 ms 72348 KB Output is correct
72 Correct 42 ms 72372 KB Output is correct
73 Correct 41 ms 72328 KB Output is correct
74 Correct 41 ms 72328 KB Output is correct
75 Correct 1 ms 596 KB Output is correct
76 Correct 44 ms 72372 KB Output is correct
77 Correct 1 ms 596 KB Output is correct
78 Correct 42 ms 72312 KB Output is correct
79 Correct 1 ms 596 KB Output is correct
80 Correct 63 ms 212 KB Output is correct
81 Correct 18 ms 212 KB Output is correct
82 Correct 119 ms 312 KB Output is correct
83 Correct 35 ms 212 KB Output is correct
84 Correct 69 ms 212 KB Output is correct
85 Correct 36 ms 61524 KB Output is correct
86 Correct 30 ms 50676 KB Output is correct
87 Correct 25 ms 43992 KB Output is correct
88 Correct 31 ms 51020 KB Output is correct
89 Correct 33 ms 57836 KB Output is correct
90 Correct 48 ms 71500 KB Output is correct
91 Correct 50 ms 53560 KB Output is correct
92 Correct 50 ms 65964 KB Output is correct
93 Correct 63 ms 73780 KB Output is correct
94 Correct 184 ms 340 KB Output is correct
95 Correct 395 ms 460 KB Output is correct
96 Correct 292 ms 340 KB Output is correct
97 Correct 240 ms 340 KB Output is correct
98 Correct 194 ms 344 KB Output is correct
99 Correct 42 ms 72584 KB Output is correct
100 Correct 43 ms 72664 KB Output is correct
101 Correct 41 ms 72620 KB Output is correct
102 Correct 44 ms 72572 KB Output is correct
103 Correct 42 ms 72632 KB Output is correct
104 Correct 46 ms 72692 KB Output is correct
105 Correct 65 ms 76604 KB Output is correct
106 Correct 68 ms 76620 KB Output is correct
107 Correct 65 ms 76644 KB Output is correct
108 Correct 10 ms 852 KB Output is correct
109 Execution timed out 1578 ms 572 KB Time limit exceeded
110 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 43 ms 72268 KB Output is correct
16 Correct 42 ms 72276 KB Output is correct
17 Correct 44 ms 72376 KB Output is correct
18 Correct 51 ms 72360 KB Output is correct
19 Correct 44 ms 72328 KB Output is correct
20 Correct 42 ms 72340 KB Output is correct
21 Correct 41 ms 72336 KB Output is correct
22 Correct 41 ms 72372 KB Output is correct
23 Correct 40 ms 72404 KB Output is correct
24 Correct 58 ms 76620 KB Output is correct
25 Correct 68 ms 76544 KB Output is correct
26 Correct 71 ms 76552 KB Output is correct
27 Correct 7 ms 852 KB Output is correct
28 Correct 6 ms 852 KB Output is correct
29 Correct 5 ms 852 KB Output is correct
30 Correct 7 ms 788 KB Output is correct
31 Correct 5 ms 852 KB Output is correct
32 Correct 4 ms 852 KB Output is correct
33 Correct 85 ms 74136 KB Output is correct
34 Correct 86 ms 74184 KB Output is correct
35 Correct 86 ms 74148 KB Output is correct
36 Correct 83 ms 74224 KB Output is correct
37 Correct 84 ms 74244 KB Output is correct
38 Correct 86 ms 74208 KB Output is correct
39 Correct 99 ms 77656 KB Output is correct
40 Correct 99 ms 77648 KB Output is correct
41 Correct 92 ms 77560 KB Output is correct
42 Correct 39 ms 2800 KB Output is correct
43 Correct 18 ms 1884 KB Output is correct
44 Correct 26 ms 3020 KB Output is correct
45 Correct 14 ms 2004 KB Output is correct
46 Correct 11 ms 1896 KB Output is correct
47 Correct 17 ms 3020 KB Output is correct
48 Correct 1328 ms 86816 KB Output is correct
49 Correct 591 ms 73548 KB Output is correct
50 Correct 390 ms 71728 KB Output is correct
51 Correct 676 ms 72500 KB Output is correct
52 Correct 922 ms 74044 KB Output is correct
53 Correct 836 ms 59468 KB Output is correct
54 Correct 33 ms 3060 KB Output is correct
55 Correct 43 ms 3024 KB Output is correct
56 Correct 26 ms 3020 KB Output is correct
57 Correct 19 ms 3020 KB Output is correct
58 Correct 18 ms 3008 KB Output is correct
59 Correct 17 ms 3020 KB Output is correct
60 Execution timed out 1581 ms 88564 KB Time limit exceeded
61 Halted 0 ms 0 KB -