답안 #934361

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
934361 2024-02-27T08:12:09 Z browntoad Toxic Gene (NOI23_toxic) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "toxic.h"
using namespace std;
 
void determine_type(int n){
 
    vector<int> T, N, S;
    int tid = -1;
    for (int i = 1; i <= n; i++){
        int ret = query_sample({i});
        if (ret == 0){
            tid = i;
            answer_type({i, 'T'});
        }
        else T.push_back(i);
    }
    for (int toad:T){
        int ret = query_sample({toad, tid});
        if (ret == 0){
            answer_type({toad, 'N'});
        }
        else answer_type({toad, 'S'});
    }
 
}

Compilation message

toxic.cpp: In function 'void determine_type(int)':
toxic.cpp:13:33: error: cannot convert '<brace-enclosed initializer list>' to 'int'
   13 |             answer_type({i, 'T'});
      |                                 ^
      |                                 |
      |                                 <brace-enclosed initializer list>
In file included from toxic.cpp:2:
toxic.h:5:22: note:   initializing argument 1 of 'void answer_type(int, char)'
    5 | void answer_type(int x, char c);
      |                  ~~~~^
toxic.cpp:20:36: error: cannot convert '<brace-enclosed initializer list>' to 'int'
   20 |             answer_type({toad, 'N'});
      |                                    ^
      |                                    |
      |                                    <brace-enclosed initializer list>
In file included from toxic.cpp:2:
toxic.h:5:22: note:   initializing argument 1 of 'void answer_type(int, char)'
    5 | void answer_type(int x, char c);
      |                  ~~~~^
toxic.cpp:22:37: error: cannot convert '<brace-enclosed initializer list>' to 'int'
   22 |         else answer_type({toad, 'S'});
      |                                     ^
      |                                     |
      |                                     <brace-enclosed initializer list>
In file included from toxic.cpp:2:
toxic.h:5:22: note:   initializing argument 1 of 'void answer_type(int, char)'
    5 | void answer_type(int x, char c);
      |                  ~~~~^