답안 #923170

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
923170 2024-02-06T19:16:48 Z alexdd Super Dango Maker (JOI22_dango3) C++17
7 / 100
210 ms 636 KB
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
int n,m;
vector<int> ord;
void scoate_unu()
{
    int ult=-1;
    vector<int> aux;
    for(int i=0;i<ord.size();i++)
    {
        aux.push_back(ord[i]);
        if(Query(aux)==1)
        {
            ult=i;
            break;
        }
    }
    aux.clear();
    for(int i=ult;i>=0;i--)
    {
        vector<int> cv = aux;
        for(int j=i-1;j>=0;j--)
            cv.push_back(ord[j]);
        if(ult==n-1 || i==ult || Query(cv)==0)
        {
            aux.push_back(ord[i]);
            ord.erase(ord.begin()+i);
        }
    }
    ///scoate din ord
    Answer(aux);
}
void Solve(int N, int M)
{
    n=N;
    m=M;
    for(int i=1;i<=n*m;i++)
        ord.push_back(i);
    random_shuffle(ord.begin(),ord.end());
    for(int i=1;i<m;i++)
    {
        scoate_unu();
    }
    Answer(ord);
}
/**

3 2
3 3 1 2 1 2

*/

Compilation message

dango3.cpp: In function 'void scoate_unu()':
dango3.cpp:10:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |     for(int i=0;i<ord.size();i++)
      |                 ~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 344 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 5 ms 348 KB Output is correct
2 Correct 5 ms 348 KB Output is correct
3 Correct 4 ms 496 KB Output is correct
4 Correct 4 ms 348 KB Output is correct
5 Correct 4 ms 348 KB Output is correct
6 Correct 4 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 90 ms 572 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 210 ms 636 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -