답안 #1016201

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1016201 2024-07-07T13:52:38 Z walizamanee Super Dango Maker (JOI22_dango3) C++17
컴파일 오류
0 ms 0 KB

#include<bits/stdc++.h>
using namespace std;
//int Query(vector<int> hehe);
//int Answer( vector<int> lmao );
void Solve(int N, int M) {
   vector<int> one;
   for( int z = 0; z < N * M; z++ ) one.push_back(z + 1);
   for( int z = 0; z < M; z++ ) {
       vector<int> ans;
      // vector<int> one = arr;
       ans.clear();
       //ans.push_back(one[one.size() - 1]);
      // one.pop_back();
       int siz = one.size();
       while( ans.size() != N ) {
           long long lo = ( rand() * rand() ) % (long long)( siz );
           int lol = (int)lo;
           int bruh = one[lol];
           one.erase(one.begin() + lol);
           int an = Query(one);
           if( an != (M - z) + 1 ) one.push_back(bruh);
           else ans.push_back(bruh);
           siz--;
       }
       Answer( ans ); 
   }
}

/*int main() {
   for( int z = 0; z < 10; z++ ) cout << rand() << " ";
   
} */



Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:17:26: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   17 |        while( ans.size() != N ) {
      |               ~~~~~~~~~~~^~~~
dango3.cpp:22:21: error: 'Query' was not declared in this scope
   22 |            int an = Query(one);
      |                     ^~~~~
dango3.cpp:27:8: error: 'Answer' was not declared in this scope
   27 |        Answer( ans );
      |        ^~~~~~