Submission #545189

#TimeUsernameProblemLanguageResultExecution timeMemory
545189chonkaSuper Dango Maker (JOI22_dango3)C++17
100 / 100
3225 ms532 KiB
#include<bits/stdc++.h> #include "dango3.h" using namespace std ; int n , m ; vector < int > aux ; int comp[ 10007 ] ; int ask ( int tp ) { if ( tp == 0 ) { return 0 ; } aux.clear ( ) ; for ( int i = 1 ; i <= n * m ; ++ i ) { if ( comp[ i ] > tp ) { aux.push_back ( i ) ; } } return ( m - Query ( aux ) ) ; } vector < int > gr[ 27 ] ; void Solve ( int N , int M ) { n = N , m = M ; for ( int i = 1 ; i <= n * m ; ++ i ) { comp[ i ] = 32 ; } for ( int i = 1 ; i <= n * m ; ++ i ) { int l , r , mid ; l = 1 ; r = m ; while ( l < r ) { mid = ( l + r ) / 2 ; comp[ i ] = mid ; int ret = ask ( mid ) ; if ( ret <= mid ) { r = mid ; } else { l = mid + 1 ; } } comp[ i ] = r ; gr[ comp[ i ] ].push_back ( i ) ; } for ( int i = 1 ; i <= m ; ++ i ) { Answer ( gr[ i ] ) ; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...