답안 #120355

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
120355 2019-06-24T08:48:47 Z 송준혁(#2952) 통행료 (IOI18_highway) C++14
5 / 100
31 ms 508 KB
#include <bits/stdc++.h>
#include "highway.h"
using namespace std;

int chk[110];

void find_pair(int N, vector<int> U, vector<int> V, int A, int B) {
    vector<int> Q(U.size(), 0);
    int X = ask(Q);
    for (int i=0; i<U.size(); i++){
        Q[i] = 1;
        if (X != ask(Q)) chk[U[i]]++, chk[V[i]]++;
        Q[i] = 0;
    }
    int S=-1, T=-1;
    for (int i=0; i<N; i++){
        if (chk[i] == 1){
            if (S == -1) S = i;
            else T = i;
        }
    }
    answer(S, T);
}

Compilation message

highway.cpp: In function 'void find_pair(int, std::vector<int>, std::vector<int>, int, int)':
highway.cpp:10:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0; i<U.size(); i++){
                   ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 292 KB Output is correct
2 Correct 3 ms 248 KB Output is correct
3 Correct 3 ms 292 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 248 KB Output is correct
6 Correct 3 ms 248 KB Output is correct
7 Correct 2 ms 248 KB Output is correct
8 Correct 3 ms 380 KB Output is correct
9 Correct 3 ms 248 KB Output is correct
10 Correct 2 ms 248 KB Output is correct
11 Correct 3 ms 424 KB Output is correct
12 Correct 3 ms 380 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 248 KB Output is incorrect: more than 100 calls to ask.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 21 ms 440 KB Output is incorrect: more than 100 calls to ask.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 248 KB Output is incorrect: more than 100 calls to ask.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 31 ms 440 KB Output is incorrect: more than 100 calls to ask.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 22 ms 508 KB Output is incorrect: more than 100 calls to ask.
2 Halted 0 ms 0 KB -