답안 #998429

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
998429 2024-06-14T01:37:25 Z efishel Super Dango Maker (JOI22_dango3) C++17
22 / 100
251 ms 604 KB
//Logan/Dango
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;

void Solve(int N, int M){
    srand(94894571);
    int used[N*M+1],dis=N*M;
    vector<int>r,rs[M];
    for(int i=1;i<=N*M;i++)used[i]=0;
    for(int i=1;i<=M;i++){
        while(r.size()<N||!Query(r)){
            int j=1,k=rand()%dis;
            while(true){
                if(used[j])j++;
                else if(k)j++,k--;
                else break;
            }
            r.push_back(j);
            used[j]=1,dis--;
        }
        while(N<r.size()){
            int t=r[0];
            r.erase(r.begin());
            if(!Query(r))r.push_back(t);
            else used[t]=0,dis++;
        }
        Answer(r);
        r.clear();
    }
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:12:23: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   12 |         while(r.size()<N||!Query(r)){
      |               ~~~~~~~~^~
dango3.cpp:22:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |         while(N<r.size()){
      |               ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 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 Correct 4 ms 344 KB Output is correct
2 Correct 5 ms 348 KB Output is correct
3 Correct 5 ms 600 KB Output is correct
4 Correct 4 ms 348 KB Output is correct
5 Correct 3 ms 348 KB Output is correct
6 Correct 3 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 80 ms 540 KB Output is correct
2 Correct 85 ms 544 KB Output is correct
3 Correct 84 ms 344 KB Output is correct
4 Correct 95 ms 348 KB Output is correct
5 Correct 85 ms 348 KB Output is correct
6 Correct 91 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 251 ms 604 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -