답안 #532217

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
532217 2022-03-02T13:54:26 Z christinelynn 사육제 (CEOI14_carnival) C++17
20 / 100
247 ms 556 KB
#include <bits/stdc++.h>
#define REP(v, i, j) for (int v = i; v < j; v++)
#define FORI(v) for (auto i : v)
#define FORJ(v) for (auto j : v)

#define OUT(v, a)     FORI(v)           cout << i << a;
#define OUTS(v, a, b)          cout << v.size() << a;     OUT(v, b)
#define in(a, n)     REP(i, 0, n)     cin >> a[i];

#define SORT(v) sort(begin(v), end(v))
#define REV(v) reverse(begin(v), end(v))

#define pb push_back
#define fi first
#define se second

#define detachIO                          ios_base::sync_with_stdio(false);     cin.tie(0);                           cout.tie(0);

using namespace std;

typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef pair<pii, pii> piiii;

int c[300][300];
int ans[300];

int t[10] = {0, 1, 2, 1, 3, 2};

int query(int x, int y)
{
    if (c[x][y] != 0)
        return c[x][y];

    cout << (y - x + 1);

    REP(i, x, y + 1)
    cout << ' ' << i;
    cout << endl;

    int resp;
    cin >> resp;
    c[x][y] = resp;
    return resp;

    // set<int> st;

    // REP(i, x, y + 1)
    // st.insert(t[i]);
    // return st.size();
}

int main()
{
    int n;
    cin >> n;
    ans[1] = 1;
    int alloc = 2;

    REP(i, 2, n + 1)
    {
        int x = -1;

        REP(j, 1, i)
        if (query(j, i - 1) == query(j, i))
            x = j;

        if (x > 0)
            ans[i] = ans[x];
        else
            ans[i] = alloc++;
    }

    cout << 0;

    REP(i, 1, n + 1)
    cout << ' ' << ans[i];
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 136 ms 420 KB Partially correct
2 Partially correct 136 ms 428 KB Partially correct
3 Partially correct 131 ms 400 KB Partially correct
4 Partially correct 92 ms 416 KB Partially correct
5 Partially correct 109 ms 556 KB Partially correct
6 Partially correct 164 ms 364 KB Partially correct
7 Partially correct 247 ms 432 KB Partially correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 155 ms 460 KB Partially correct
2 Partially correct 158 ms 444 KB Partially correct
3 Partially correct 107 ms 400 KB Partially correct
4 Partially correct 151 ms 332 KB Partially correct
5 Partially correct 84 ms 428 KB Partially correct
6 Partially correct 127 ms 340 KB Partially correct
7 Partially correct 148 ms 420 KB Partially correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 114 ms 328 KB Partially correct
2 Partially correct 143 ms 424 KB Partially correct
3 Partially correct 135 ms 348 KB Partially correct
4 Partially correct 164 ms 424 KB Partially correct
5 Partially correct 135 ms 344 KB Partially correct
6 Partially correct 178 ms 448 KB Partially correct
7 Partially correct 147 ms 440 KB Partially correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 153 ms 440 KB Partially correct
2 Partially correct 186 ms 448 KB Partially correct
3 Partially correct 133 ms 460 KB Partially correct
4 Partially correct 164 ms 444 KB Partially correct
5 Partially correct 139 ms 432 KB Partially correct
6 Partially correct 145 ms 440 KB Partially correct
7 Partially correct 109 ms 436 KB Partially correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 150 ms 448 KB Partially correct
2 Partially correct 170 ms 432 KB Partially correct
3 Partially correct 168 ms 444 KB Partially correct
4 Partially correct 166 ms 440 KB Partially correct
5 Partially correct 167 ms 444 KB Partially correct
6 Partially correct 135 ms 328 KB Partially correct
7 Partially correct 154 ms 440 KB Partially correct