답안 #945211

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
945211 2024-03-13T14:20:45 Z onepunchac168 Super Dango Maker (JOI22_dango3) C++17
2 / 100
723 ms 1116 KB
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;

vector <int> tmp[25];
#define pb push_back
void Solve(int n, int m) {
    int dem=0;
    vector <int> target;
    for (int i=1;i<=n*m;i++)
    {
        target.push_back(i);
    }
    while (m>5)
    {
        dem++;
        vector <int> need;
        vector <int> needa;
        for (int i=0;i<target.size();i++)
        {
            vector <int> cnt;
            for (int j=i+1;j<target.size();j++)
            {
                cnt.push_back(target[j]);
            }
            for (auto v:need)
            {
                cnt.push_back(v);
            }
            if (Query(cnt)>=m-5)
            {
                needa.pb(target[i]);
            }
            else need.pb(target[i]);
        }
        for (auto v:needa)
        {
            tmp[dem].pb(v);
        }
        m-=5;
    }
    if (m>0)
    {
        dem++;
        for (auto v:target)
        {
            tmp[dem].push_back(v);
        }
    }
    for (int i=1;i<=dem;i++)
    {
        vector <int> rr=tmp[i];
        int kk=rr.size()/n;
        while (rr.size()>n)
        {
            kk--;
            vector <int> need;
            vector <int> needa;
            for (int i=0;i<rr.size();i++)
            {
                vector <int> cnt;
                for (int j=i+1;j<rr.size();j++)
                {
                    cnt.push_back(rr[j]);
                }
                for (auto v:need)
                {
                    cnt.push_back(v);
                }
                if (Query(cnt)>=kk)
                {
                    needa.pb(rr[i]);
                }
                else need.pb(rr[i]);
            }
            Answer(needa);
            swap(need,rr);
        }
        Answer(rr);
    }
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:19:23: 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<target.size();i++)
      |                      ~^~~~~~~~~~~~~~
dango3.cpp:22:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |             for (int j=i+1;j<target.size();j++)
      |                            ~^~~~~~~~~~~~~~
dango3.cpp:54:25: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   54 |         while (rr.size()>n)
      |                ~~~~~~~~~^~
dango3.cpp:59:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   59 |             for (int i=0;i<rr.size();i++)
      |                          ~^~~~~~~~~~
dango3.cpp:62:33: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   62 |                 for (int j=i+1;j<rr.size();j++)
      |                                ~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 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 496 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 532 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 213 ms 1116 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 723 ms 600 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -