Submission #596812

# Submission time Handle Problem Language Result Execution time Memory
596812 2022-07-15T06:16:44 Z 이동현(#8450) Super Dango Maker (JOI22_dango3) C++17
100 / 100
2896 ms 700 KB
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;

namespace {

int variable_example = 1;

}  // namespace

void Solve(int N, int M) {
    vector<vector<int>> a(M);
    for(int i = 1; i <= N * M; ++i){
        int low = 0, high = M - 1, mid;
        while(low < high){
            mid = low + high >> 1;
            vector<int> ask;
            for(int j = i + 1; j <= N * M; ++j){
                ask.push_back(j);
            }
            for(int j = mid + 1; j < M; ++j){
                for(auto&k:a[j]) ask.push_back(k);
            }
            if(Query(ask) >= M - mid - 1){
                high = mid;
            }
            else{
                low = mid + 1;
            }
        }
        a[low].push_back(i);
    }
    for(int i = 0; i < M; ++i){
        Answer(a[i]);
    }
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:16:23: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   16 |             mid = low + high >> 1;
      |                   ~~~~^~~~~~
dango3.cpp: At global scope:
dango3.cpp:7:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    7 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 20 ms 340 KB Output is correct
2 Correct 19 ms 404 KB Output is correct
3 Correct 23 ms 372 KB Output is correct
4 Correct 25 ms 340 KB Output is correct
5 Correct 19 ms 340 KB Output is correct
6 Correct 18 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 550 ms 568 KB Output is correct
2 Correct 570 ms 576 KB Output is correct
3 Correct 742 ms 584 KB Output is correct
4 Correct 682 ms 592 KB Output is correct
5 Correct 539 ms 448 KB Output is correct
6 Correct 528 ms 452 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2187 ms 652 KB Output is correct
2 Correct 2166 ms 660 KB Output is correct
3 Correct 2819 ms 612 KB Output is correct
4 Correct 2896 ms 700 KB Output is correct
5 Correct 2140 ms 548 KB Output is correct
6 Correct 2177 ms 536 KB Output is correct