Submission #905157

# Submission time Handle Problem Language Result Execution time Memory
905157 2024-01-12T16:37:21 Z Ahmed57 Super Dango Maker (JOI22_dango3) C++17
22 / 100
268 ms 704 KB
#include "dango3.h"
 
#include <bits/stdc++.h>
using namespace std;
 
void Solve(int n,int m){
    int taked[n*m+1] = {0};
    for(int i = 0;i<m-1;i++){
        vector<int> lol;
        for(int j = 1;j<=n*m;j++){
            if(taked[j]==0){
                lol.push_back(j);
            }
        }
        vector<int> ans;
        int mi = lol.size()-1;
        for(int j = 1;j<=n;j++){
            int l = n-j , r = mi , an = 0;
            while(l<=r){
                int mid = (l+r)/2;
                vector<int> ex;
                for(auto i:ans)ex.push_back(i);
                for(int j = 0;j<=mid;j++){
                    ex.push_back(lol[j]);
                }
                if(Query(ex)>=1){
                    an = mid;
                    r = mid-1;
                }else l = mid+1;
            }
            mi = min(mi,an-1);
            ans.push_back(lol[an]);
        }
        for(auto i:ans)taked[i] = 1;
        Answer(ans);
    }
    vector<int> v;
    for(int i = 1;i<=n*m;i++){
        if(taked[i]==0){
            v.push_back(i);
        }
    }
    Answer(v);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 504 KB Output is correct
4 Correct 1 ms 508 KB Output is correct
5 Correct 1 ms 360 KB Output is correct
6 Correct 1 ms 436 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 504 KB Output is correct
2 Correct 6 ms 512 KB Output is correct
3 Correct 13 ms 516 KB Output is correct
4 Correct 12 ms 344 KB Output is correct
5 Correct 2 ms 448 KB Output is correct
6 Correct 2 ms 452 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 66 ms 600 KB Output is correct
2 Correct 65 ms 592 KB Output is correct
3 Correct 266 ms 616 KB Output is correct
4 Correct 268 ms 632 KB Output is correct
5 Correct 17 ms 620 KB Output is correct
6 Correct 18 ms 472 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 195 ms 704 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -