답안 #948320

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
948320 2024-03-18T04:06:30 Z Alkarat Super Dango Maker (JOI22_dango3) C++17
100 / 100
367 ms 1076 KB
#include "dango3.h"
#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ll long long
#define ldb long double
#define db double
#define fin(x) freopen(x,"r",stdin)
#define fout(x) freopen(x,"w",stdout)
#define fo(i,l,r) for(int i=(l);i<=(r);i++)
#define foi(i,l,r) for(int i=(l);i>=(r);i--)
#define el cout<<'\n';
#define cel cerr<<'\n';
#define all(x) x.begin(),x.end()
#define ii pair<int,int>
#define iii pair<int,ii>
#define gb(x,i) (((x)>>(i))&1)
#define mask(i) (1LL<<(i))
#define TIME (1.0 * clock()/CLOCKS_PER_SEC)
using namespace std;
const int mxN=1e5+4;
const int bl=60;
const ll base=1e9+7;
const ll inf=1e9;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll Rand(ll l,ll r)
{
    return l+(1ll*rng()*rng()%(r-l+1)+(r-l+1))%(r-l+1);
}
template<class X,class Y>bool maximize(X &a,Y b)
{
    if(a<b) return a=b,true;
    return false;
}
template<class X,class Y>bool minimize(X &a, Y b)
{
    if(a>b) return a=b,true;
    return false;
}
void add(auto &a,auto b)
{
    a+=b;
    if(a>=base) a-=base;
    if(a<0) a+=base;
}
int per;
void tryy(int sl,vector<int>id)
{
    if(sl==1)
    {
        Answer(id);
        return;
    }
    int mid=sl/2;
    vector<int>tl,tr;
    while(id.size())
    {
        int x=id.back();
        id.pop_back();
        vector<int>cc=tl;
        for(int e:id) cc.pb(e);
        if(Query(cc)>=mid) tr.pb(x);
        else tl.pb(x);
    }
    tryy(mid,tl),tryy(sl-mid,tr);
}
void Solve(int n,int m)
{
    vector<int>cc;
    fo(i,1,n*m) cc.pb(i);
    per=n,tryy(m,cc);
}

Compilation message

dango3.cpp:42:10: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   42 | void add(auto &a,auto b)
      |          ^~~~
dango3.cpp:42:18: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   42 | void add(auto &a,auto b)
      |                  ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 344 KB Output is correct
2 Correct 4 ms 348 KB Output is correct
3 Correct 4 ms 348 KB Output is correct
4 Correct 4 ms 344 KB Output is correct
5 Correct 4 ms 600 KB Output is correct
6 Correct 4 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 85 ms 656 KB Output is correct
2 Correct 88 ms 600 KB Output is correct
3 Correct 101 ms 648 KB Output is correct
4 Correct 94 ms 600 KB Output is correct
5 Correct 77 ms 600 KB Output is correct
6 Correct 79 ms 624 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 332 ms 940 KB Output is correct
2 Correct 355 ms 856 KB Output is correct
3 Correct 365 ms 848 KB Output is correct
4 Correct 367 ms 1076 KB Output is correct
5 Correct 296 ms 1016 KB Output is correct
6 Correct 345 ms 764 KB Output is correct