답안 #944980

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
944980 2024-03-13T09:25:46 Z itslq 카멜레온의 사랑 (JOI20_chameleon) C++17
0 / 100
1 ms 344 KB
#include "chameleon.h"
#include <bits/stdc++.h>
using namespace std;

void answer(int a, int b) {
    Answer(++a, ++b);
}

vector<int> without(int a, int b, int N) {
    vector<int> ans;
    ++a; ++b;
    for (int i = 1; i <= 2 * N; i++) {
        if (i != a && i != b) {
            ans.push_back(i);
        }
    }
    return ans;
}

void Solve(int N) {
    vector<bool> done(2 * N);
    vector<vector<int>> crit(2 * N);

    for (int i = 0; i < 2 * N; i++) {
        for (int j = 0; j < i; j++) {
            cout << "Query " << i + 1 << " and " << j + 1 << ": " <<  Query(vector<int>{i + 1, j + 1}) << endl;
            if (Query(vector<int>{i + 1, j + 1}) == 1) {
                crit[i].push_back(j);
                crit[j].push_back(i);
            }
        }
    }

    for (int i = 0; i < 2 * N; i++) {
        if (done[i]) continue;

        for (int j = 0; j < crit[i].size(); j++) {
            if (done[crit[i][j]]) continue;

            if (Query(without(i, crit[i][j], N)) <= N - 1) {
                answer(i, crit[i][j]);
                done[crit[i][j]] = 1;
                done[i] = 1;
            }
        }
    }
}

Compilation message

chameleon.cpp: In function 'void Solve(int)':
chameleon.cpp:37:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   37 |         for (int j = 0; j < crit[i].size(); j++) {
      |                         ~~^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Line [name=secret] equals to "Query 2 and 1: 2", doesn't correspond to pattern "[A-Za-z0-9]{1,100}"
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Line [name=secret] equals to "Query 2 and 1: 2", doesn't correspond to pattern "[A-Za-z0-9]{1,100}"
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Line [name=secret] equals to "Query 2 and 1: 2", doesn't correspond to pattern "[A-Za-z0-9]{1,100}"
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB Line [name=secret] equals to "Query 2 and 1: 2", doesn't correspond to pattern "[A-Za-z0-9]{1,100}"
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Line [name=secret] equals to "Query 2 and 1: 2", doesn't correspond to pattern "[A-Za-z0-9]{1,100}"
2 Halted 0 ms 0 KB -