답안 #998439

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
998439 2024-06-14T01:51:42 Z jampm Super Dango Maker (JOI22_dango3) C++17
2 / 100
567 ms 512 KB
#include "dango3.h"
//Emmanuel B
//dango




#include <bits/stdc++.h>
using namespace std;
using lli=long long int;
#define pb push_back
#define deb(x) cout<<#x<<": "<<x<<endl;
#define deb2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl;

void Solve(int N, int M) {
   mt19937 gen;
 
    // Seed the engine with an unsigned int
    gen.seed(24234234);
//  std::cout << "after seed by 1: " << gen() << '\n';

  int cnt=0;
  queue<int> q;
  for(int i=1; i<=N*M; ++i){
    q.push(i);
  }
  while(cnt<M){
    vector<int> x;
    while(x.size()<N){
    if(gen()%2){
      x.pb(q.front());
      q.pop();
    }
    else{
      q.push(q.front());
      q.pop();
    }
    }
    if(Query(x)){
      Answer(x);
      cnt++;
    }
    else{
      for(int y:x){
        q.push(y);
      }
    }
  }
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:29:19: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   29 |     while(x.size()<N){
      |           ~~~~~~~~^~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 156 ms 348 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 323 ms 512 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 567 ms 344 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -