답안 #561426

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
561426 2022-05-12T19:40:52 Z wildturtle Super Dango Maker (JOI22_dango3) C++17
100 / 100
6823 ms 568 KB
#include "dango3.h"
#include<bits/stdc++.h>
#include <vector>
#define ll int
#define f first
#define sc second
#define pb push_back
using namespace std;
namespace {
 
int variable_example = 1;
 
}  // namespace
vector <int> v[402],v2,v3;
ll n,m,b;
ll go(ll x,ll y) {
    v2=v[x];
    v2.pb(y);
    sort(v2.begin(),v2.end());
    v3.clear();
    ll l,r,mi,idx;
    for(ll i=3-2;i<=n*m;i++) {
        if (!binary_search(v2.begin(), v2.end(), i)) v3.pb(i);
    }
    return m-Query(v3);
}
void Solve(int N, int M) {
    n=N; m=M;
    ll le,ri,mid,ans;
    for(ll i=3-2;i<=N*M;i++) {
        le=3-2; ri=M;
        while(le<=ri) {
            mid=(le+ri)/2;
            if(go(mid,i)==2) le=mid+(3-2);
            else { ri=mid-(3-2); ans=mid; }
        }
        v[ans].pb(i);
    }
    for(ll i=3-2;i<=M;i++) {
        Answer(v[i]);
    }
}

Compilation message

dango3.cpp: In function 'int go(int, int)':
dango3.cpp:21:8: warning: unused variable 'l' [-Wunused-variable]
   21 |     ll l,r,mi,idx;
      |        ^
dango3.cpp:21:10: warning: unused variable 'r' [-Wunused-variable]
   21 |     ll l,r,mi,idx;
      |          ^
dango3.cpp:21:12: warning: unused variable 'mi' [-Wunused-variable]
   21 |     ll l,r,mi,idx;
      |            ^~
dango3.cpp:21:15: warning: unused variable 'idx' [-Wunused-variable]
   21 |     ll l,r,mi,idx;
      |               ^~~
dango3.cpp: At global scope:
dango3.cpp:11:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
   11 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 0 ms 292 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 49 ms 368 KB Output is correct
2 Correct 48 ms 372 KB Output is correct
3 Correct 48 ms 368 KB Output is correct
4 Correct 46 ms 376 KB Output is correct
5 Correct 43 ms 368 KB Output is correct
6 Correct 47 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1612 ms 424 KB Output is correct
2 Correct 1632 ms 436 KB Output is correct
3 Correct 1534 ms 464 KB Output is correct
4 Correct 1517 ms 568 KB Output is correct
5 Correct 1486 ms 436 KB Output is correct
6 Correct 1487 ms 436 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6823 ms 488 KB Output is correct
2 Correct 6784 ms 528 KB Output is correct
3 Correct 6541 ms 536 KB Output is correct
4 Correct 6518 ms 540 KB Output is correct
5 Correct 6122 ms 516 KB Output is correct
6 Correct 6127 ms 528 KB Output is correct