Submission #1217235

#TimeUsernameProblemLanguageResultExecution timeMemory
1217235Ak_16Chorus (JOI23_chorus)C++20
In queue
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int p[100]; void cnst(int k, int l, int r){ if(l>r){return;} if(k>=r-l){ p[r-l+1] = l; k-= (r-l); cnst(k, l+1, r); } else { p[r-l+1] = r; cnst(k, l, r-1); } } int x[250]; int y[250]; int main(){ cin.tie(nullptr); int c1 = 5000; int c2 = 9000; int cnt = -1; for(int i=0; i<50; i++){ cnt++; x[cnt] = c1 + 2500 - i*i; y[cnt] = c2 + i; } for(int i=0; i<50; i++){ cnt++; x[cnt] = c1 - 2500 + (50-i)*(50-i); y[cnt] = c2 + 50 - i; } for(int i=0; i<50; i++){ cnt++; x[cnt] = c1 - 2500+i*i; y[cnt] = c2-i; } for(int i=0; i<49; i++){ cnt++; x[cnt] = c1 + 2500 - (50-i)*(50-i); y[cnt] = c2 + i-50; } for(int i=1; i<=24; i++){ cnt++; x[cnt] = 5000+i; y[cnt] = 1; } for(int i=1; i<=24; i++){ cnt++; x[cnt] = 5000+i; y[cnt] = 0; } cout<<19582<<endl; for(int i=0; i<=19305; i++){ cout<<247<<endl; int qu = i/197; int re = i - qu * 197; for(int j=0; j<=198; j++){ cout<<x[j*(qu+1)%199]<<" "<<y[j*(qu+1)%199]<<endl; } cnst(re, 1, 24); for(int j=1; j<=48; j++){ if(j%4==1||j%4==0){ cout<<5000 + (j+1)/2 <<" "<<1<<endl; } else { cout<<5000 + p[(j+1)/2] << " "<<0<<endl; } } } for(int i=19306; i<=19582; i++){ cout<<247<<endl; for(int j=0; j<=198; j++){ cout<<x[(j*99)%199]<<" "<<y[(j*99)%199]<<endl; } int re = i - 19306; cnst(re, 1, 24); for(int j=1; j<=48; j++){ if(j%4==1||j%4==0){ cout<<5000 + (j+1)/2 <<" "<<1<<endl; } else { cout<<5000 + p[(j+1)/2] << " "<<0<<endl; } } } }