답안 #900644

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
900644 2024-01-08T19:03:56 Z alexander707070 Super Dango Maker (JOI22_dango3) C++17
0 / 100
699 ms 1048576 KB
#include<bits/stdc++.h>
#include "dango3.h"
using namespace std;

int n,m;

int li[10007],tim;
vector<int> v;

void solve(vector<int> el){
    if(el.size()==n){
        Answer(el); return;
    }

    int half=(el.size()/n)/2;
    vector<int> curr,rest;
    deque<int> d;

    for(int i=0;i<el.size();i++){
        curr.push_back(el[i]);
        if(Query(curr)==half)break;
    }

    for(int i:curr)d.push_back(i);

    int sz=curr.size(),rem=0;
    for(int i=0;i<sz;i++){
        rem=d.back();
        d.pop_back();

        curr={};
        for(int f=0;f<d.size();f++){
            curr.push_back(d[f]);
        }

        if(Query(curr)==half)continue;
        else d.push_front(rem);
    }

    tim++;
    for(int i=0;i<d.size();i++){
        curr.push_back(d[i]);
        li[d[i]]=true;
    }

    for(int i=0;i<el.size();i++){
        if(li[el[i]]!=tim)rest.push_back(el[i]);
    }

    solve(curr);
    solve(rest);
}

void Solve(int N, int M){
    n=N; m=M;

    for(int i=1;i<=n*m;i++){
        v.push_back(i);
    }

    solve(v);
}


Compilation message

dango3.cpp: In function 'void solve(std::vector<int>)':
dango3.cpp:11:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   11 |     if(el.size()==n){
      |        ~~~~~~~~~^~~
dango3.cpp:19:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |     for(int i=0;i<el.size();i++){
      |                 ~^~~~~~~~~~
dango3.cpp:32:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::deque<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |         for(int f=0;f<d.size();f++){
      |                     ~^~~~~~~~~
dango3.cpp:41:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::deque<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   41 |     for(int i=0;i<d.size();i++){
      |                 ~^~~~~~~~~
dango3.cpp:46:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   46 |     for(int i=0;i<el.size();i++){
      |                 ~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Runtime error 548 ms 1048576 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 510 ms 1048576 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 699 ms 1048576 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 544 ms 1108 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -