답안 #859112

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
859112 2023-10-09T17:59:10 Z Hanksburger Super Dango Maker (JOI22_dango3) C++17
100 / 100
2141 ms 860 KB
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> v[30], tmp;
void Solve(int n, int m)
{
    for (int i=1; i<=n*m; i++)
    {
        int l=1, r=m;
        while (l<r)
        {
            int mid=(l+r)/2, ind=0;
            tmp.clear();
            for (int j=1; j<=n*m; j++)
            {
                if (ind<v[mid].size() && v[mid][ind]==j)
                    ind++;
                else if (j!=i)
                    tmp.push_back(j);
            }
            if (Query(tmp)==m-1)
                r=mid;
            else
                l=mid+1;
        }
        v[l].push_back(i);
    }
    for (int i=1; i<=m; i++)
        Answer(v[i]);
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:16:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |                 if (ind<v[mid].size() && v[mid][ind]==j)
      |                     ~~~^~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 444 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 348 KB Output is correct
2 Correct 14 ms 348 KB Output is correct
3 Correct 15 ms 348 KB Output is correct
4 Correct 14 ms 500 KB Output is correct
5 Correct 15 ms 504 KB Output is correct
6 Correct 14 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 477 ms 600 KB Output is correct
2 Correct 472 ms 348 KB Output is correct
3 Correct 534 ms 344 KB Output is correct
4 Correct 542 ms 596 KB Output is correct
5 Correct 473 ms 568 KB Output is correct
6 Correct 474 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1910 ms 656 KB Output is correct
2 Correct 1905 ms 652 KB Output is correct
3 Correct 2136 ms 668 KB Output is correct
4 Correct 2141 ms 860 KB Output is correct
5 Correct 1913 ms 668 KB Output is correct
6 Correct 1889 ms 656 KB Output is correct