Submission #905085

# Submission time Handle Problem Language Result Execution time Memory
905085 2024-01-12T14:23:44 Z Ahmed57 Super Dango Maker (JOI22_dango3) C++17
0 / 100
2 ms 604 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;i++){
        vector<int> lol;
        for(int j = 1;j<=n*m;j++){
            if(taked[j]==0){
                lol.push_back(j);
            }
        }
        vector<int> ans;
        for(int j = 1;j<=n;j++){
            int l = 0 , r = lol.size()-1 , 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+1;
                    r = mid-1;
                }else l = mid+1;
            }
            ans.push_back(lol[an]);
        }
        for(auto i:ans)taked[i] = 1;
        Answer(ans);
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 604 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -