Submission #905213

# Submission time Handle Problem Language Result Execution time Memory
905213 2024-01-12T18:21:19 Z Ahmed57 Super Dango Maker (JOI22_dango3) C++17
0 / 100
1780 ms 680 KB
#include "dango3.h"
 
#include <bits/stdc++.h>
using namespace std;
/*
min freq
max freq
*/
void Solve(int n,int m){
    vector<int> v[m];
    int cnt = 0;
    int taked[n*m+1] = {0};
    for(int i = 1;i<=n*m;i++){
        int l = 0 , r = m-1 , ans = 0;
        while(l<=r){
            int mid = (l+r)/2;
            vector<int> d;
            cnt++;
            for(int i = 0;i<=mid;i++){
                for(auto j:v[i]){
                    taked[j] = cnt;
                }
            }
            vector<int> qu;
            for(int j = 1;j<=n*m;j++){
                if(taked[j]!=cnt){
                    qu.push_back(j);
                }
            }
            if(m-Query(qu)<=mid+1){
                ans = mid;
                r = mid-1;
            }else l = mid+1;
        }
        v[ans].push_back(i);
    }
    for(int i =0;i<m;i++){
        Answer(v[i]);
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 348 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 449 ms 596 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1780 ms 680 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -