답안 #617182

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
617182 2022-08-01T09:24:36 Z 조영욱(#8505) 카멜레온의 사랑 (JOI20_chameleon) C++17
4 / 100
220 ms 524288 KB
#include "chameleon.h"
#include <bits/stdc++.h>
using namespace std;

namespace {

int variable_example = 1;
int n;

void solve(vector<int> v) {
    if (v.size()==2) {
        Answer(v[0],v[1]);
        return;
    }
    int n=v.size()/2;
    vector<int> v1;
    vector<int> v2;
    for(int i=0;i<v.size();i++) {
        v1.push_back(v[i]);
        if (Query(v1)>n/2) {
            v1.pop_back();
            v2.push_back(v[i]);
        }
    }
    solve(v1);
    solve(v2);
}
}  // namespace

void Solve(int N) {
    n=N;
    vector<int> v;
    for(int i=1;i<=n*2;i++) {
        v.push_back(i);
    }
    solve(v);
}

Compilation message

chameleon.cpp: In function 'void {anonymous}::solve(std::vector<int>)':
chameleon.cpp:18:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |     for(int i=0;i<v.size();i++) {
      |                 ~^~~~~~~~~
chameleon.cpp: At global scope:
chameleon.cpp:7:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    7 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 260 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 12 ms 208 KB Output is correct
4 Correct 14 ms 208 KB Output is correct
5 Correct 13 ms 332 KB Output is correct
6 Correct 12 ms 336 KB Output is correct
7 Correct 12 ms 324 KB Output is correct
8 Correct 14 ms 332 KB Output is correct
9 Correct 14 ms 328 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Runtime error 220 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Runtime error 220 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 208 KB Output is correct
2 Incorrect 1 ms 208 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 260 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 12 ms 208 KB Output is correct
4 Correct 14 ms 208 KB Output is correct
5 Correct 13 ms 332 KB Output is correct
6 Correct 12 ms 336 KB Output is correct
7 Correct 12 ms 324 KB Output is correct
8 Correct 14 ms 332 KB Output is correct
9 Correct 14 ms 328 KB Output is correct
10 Correct 1 ms 208 KB Output is correct
11 Runtime error 220 ms 524288 KB Execution killed with signal 9
12 Halted 0 ms 0 KB -