답안 #945212

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
945212 2024-03-13T14:21:40 Z onepunchac168 Super Dango Maker (JOI22_dango3) C++17
22 / 100
517 ms 848 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);
        }
        swap(need,target);
        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:55:25: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   55 |         while (rr.size()>n)
      |                ~~~~~~~~~^~
dango3.cpp:60:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   60 |             for (int i=0;i<rr.size();i++)
      |                          ~^~~~~~~~~~
dango3.cpp:63:33: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   63 |                 for (int j=i+1;j<rr.size();j++)
      |                                ~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 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 6 ms 348 KB Output is correct
2 Correct 6 ms 344 KB Output is correct
3 Correct 6 ms 348 KB Output is correct
4 Correct 6 ms 348 KB Output is correct
5 Correct 5 ms 348 KB Output is correct
6 Correct 5 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 140 ms 604 KB Output is correct
2 Correct 148 ms 600 KB Output is correct
3 Correct 171 ms 620 KB Output is correct
4 Correct 168 ms 604 KB Output is correct
5 Correct 148 ms 604 KB Output is correct
6 Correct 138 ms 612 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 517 ms 848 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -