답안 #923536

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
923536 2024-02-07T11:46:44 Z alexander707070 카멜레온의 사랑 (JOI20_chameleon) C++14
0 / 100
15 ms 600 KB
#include <bits/stdc++.h>
#include "chameleon.h"
#define MAXN 1007

using namespace std;

namespace {

int n;
vector<int> to[MAXN];
vector< pair<int,int> > sol;

}  // namespace

void Solve(int N) {
    n=N;
    for(int i=1;i<=2*n;i++){
        for(int f=i+1;f<=2*n;f++){
            if(Query({i,f})==1){
                to[i].push_back(f);
                to[f].push_back(i);
            }
        }
    }

    for(int i=1;i<=2*n;i++){
        int br=0;
        for(int f=0;f<to[i].size();f++){
            for(int k:to[to[i][f]]){
                if(k==i)br++;
                if(k==i and i<to[i][f])sol.push_back({i,to[i][f]});
            }
        }
        if(br>1)cout<<1/0;
    }
    
    for(int i=0;i<sol.size();i++){
        Answer(sol[i].first,sol[i].second);
    }
}

Compilation message

chameleon.cpp: In function 'void Solve(int)':
chameleon.cpp:28:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |         for(int f=0;f<to[i].size();f++){
      |                     ~^~~~~~~~~~~~~
chameleon.cpp:34:24: warning: division by zero [-Wdiv-by-zero]
   34 |         if(br>1)cout<<1/0;
      |                       ~^~
chameleon.cpp:37:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   37 |     for(int i=0;i<sol.size();i++){
      |                 ~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Incorrect 15 ms 472 KB Wrong Answer [3]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Runtime error 1 ms 600 KB Execution killed with signal 4
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Runtime error 1 ms 600 KB Execution killed with signal 4
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Runtime error 1 ms 600 KB Execution killed with signal 4
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Incorrect 15 ms 472 KB Wrong Answer [3]
4 Halted 0 ms 0 KB -