답안 #710008

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
710008 2023-03-15T03:06:49 Z PixelCat Super Dango Maker (JOI22_dango3) C++17
2 / 100
1 ms 468 KB
#include "dango3.h"

#include <bits/stdc++.h>
#define For(i, a, b) for(int i = a; i <= b; i++)
#define Forr(i, a, b) for(int i = a; i >= b; i--)
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sz(x) ((int)x.size())
#define eb emplace_back
// #define int LL
using namespace std;
using LL = long long;
using pii = pair<int, int>;

namespace {

vector<int> cand;
vector<int> res;

int amyamya() {
    vector<int> v(all(res));
    for(auto &i:cand) v.eb(i);
    while(sz(v) && Query(v) != 0) {
        v.pop_back();
    }
    int k = sz(v) - sz(res);
    swap(cand[k], cand.back());
    k = cand.back();
    cand.pop_back();
    return k;
}

}  // namespace

void Solve(int32_t N, int32_t M) {
    assert(max(N, M) <= 4);
    For(i, 1, N * M) {
        cand.eb(i);
    }
    For(i, 1, M) {
        res.clear();
        For(j, 1, N) res.eb(amyamya());
        // For(j, 0, N - 1) cout << res[j] << " \n"[j == N - 1];
        Answer(res);
    }
}

/*

g++ -std=c++14 -O2 -o grader grader.cpp dango3.cpp & grader.exe < input.txt > output.txt 2> error.txt

*/
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 312 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -