結果
問題 | No.1698 Face to Face |
ユーザー | LayCurse |
提出日時 | 2021-09-24 03:27:11 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 4,206 bytes |
コンパイル時間 | 2,750 ms |
コンパイル使用メモリ | 223,560 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-19 10:13:25 |
合計ジャッジ時間 | 5,273 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | WA | - |
testcase_44 | WA | - |
testcase_45 | WA | - |
testcase_46 | WA | - |
testcase_47 | WA | - |
ソースコード
#pragma GCC optimize("Ofast")#pragma GCC optimize("unroll-loops")#pragma GCC optimize("inline")#include<bits/stdc++.h>using namespace std;struct Rand{unsigned x;unsigned y;unsigned z;unsigned w;Rand(void){x=123456789;y=362436069;z=521288629;w=(unsigned)time(NULL);}Rand(unsigned seed){x=123456789;y=362436069;z=521288629;w=seed;}inline unsigned get(void){unsigned t;t = (x^(x<<11));x=y;y=z;z=w;w = (w^(w>>19))^(t^(t>>8));return w;}inline double getUni(void){return get()/4294967296.0;}inline int get(int a){return (int)(a*getUni());}inline int get(int a, int b){return a+(int)((b-a+1)*getUni());}inline long long get(long long a){return(long long)(a*getUni());}inline long long get(long long a, long long b){return a+(long long)((b-a+1)*getUni());}inline double get(double a, double b){return a+(b-a)*getUni();}inline int getExp(int a){return(int)(exp(getUni()*log(a+1.0))-1.0);}inline int getExp(int a, int b){return a+(int)(exp(getUni()*log((b-a+1)+1.0))-1.0);}};struct MY_WRITER{char buf[1048576];int s;int e;MY_WRITER(){s = 0;e = 1048576;}~MY_WRITER(){if(s){fwrite_unlocked(buf, 1, s, stdout);}}};MY_WRITER MY_WRITER_VAR;void my_putchar_unlocked(int a){if(MY_WRITER_VAR.s == MY_WRITER_VAR.e){fwrite_unlocked(MY_WRITER_VAR.buf, 1, MY_WRITER_VAR.s, stdout);MY_WRITER_VAR.s = 0;}MY_WRITER_VAR.buf[MY_WRITER_VAR.s++] = a;}inline void wt_L(char a){my_putchar_unlocked(a);}inline void wt_L(int x){int s=0;int m=0;char f[10];if(x<0){m=1;x=-x;}while(x){f[s++]=x%10;x/=10;}if(!s){f[s++]=0;}if(m){my_putchar_unlocked('-');}while(s--){my_putchar_unlocked(f[s]+'0');}}Rand rnd;int N = 100000;int A[100000];int B[100000];int Z[100000];int ind[100000];int main(){int i;int j;int k;srand(time(NULL));for(i=(0);i<(N/2);i++){ind[i] = i;}random_shuffle(ind, ind+N/2);for(i=(0);i<(N);i++){Z[i] = i;}for(i=(0);i<(N/2);i++){A[2*i] = B[2*i] = 2*ind[i];A[2*i+1] = B[2*i+1] = 2*ind[i]+1;k = rand()%3;if(k==0){swap(A[2*i], A[2*i+1]);}if(k==1){swap(B[2*i], B[2*i+1]);}if(k==2){swap(Z[2*ind[i]], Z[2*ind[i]+1]);}}for(k=(0);k<(30);k++){i = rand()%N;j = rand()%N;if(i != j){if(k%3==0){swap(A[i], A[j]);}if(k%3==1){swap(B[i], B[j]);}if(k%3==2){swap(Z[i], Z[j]);}}}wt_L(N);wt_L('\n');{int WYIGIcGE;if(N==0){wt_L('\n');}else{for(WYIGIcGE=(0);WYIGIcGE<(N-1);WYIGIcGE++){wt_L(A[WYIGIcGE]+1);wt_L(' ');}wt_L(A[WYIGIcGE]+1);wt_L('\n');}}{int ao_dF3pO;if(N==0){wt_L('\n');}else{for(ao_dF3pO=(0);ao_dF3pO<(N-1);ao_dF3pO++){wt_L(B[ao_dF3pO]+1);wt_L(' ');}wt_L(B[ao_dF3pO]+1);wt_L('\n');}}{int hCmBdyQB;if(N==0){wt_L('\n');}else{for(hCmBdyQB=(0);hCmBdyQB<(N-1);hCmBdyQB++){wt_L(Z[hCmBdyQB]+1);wt_L(' ');}wt_L(Z[hCmBdyQB]+1);wt_L('\n');}}return 0;}// cLay version 20210917-1// --- original code ---// Rand rnd;// int N = 1d5, A[1d5], B[], Z[], ind[];// {// int i, j, k;// srand(time(NULL));// rep(i,N/2) ind[i] = i;// random_shuffle(ind, ind+N/2);// rep(i,N) Z[i] = i;// rep(i,N/2){// A[2*i] = B[2*i] = 2*ind[i];// A[2*i+1] = B[2*i+1] = 2*ind[i]+1;// k = rand()%3;// if(k==0) swap(A[2*i], A[2*i+1]);// if(k==1) swap(B[2*i], B[2*i+1]);// if(k==2) swap(Z[2*ind[i]], Z[2*ind[i]+1]);// }// rep(k,30){// i = rand()%N;// j = rand()%N;// if(i != j){// if(k%3==0) swap(A[i], A[j]);// if(k%3==1) swap(B[i], B[j]);// if(k%3==2) swap(Z[i], Z[j]);// }// }// wt(N);// wt(A(N)+1);// wt(B(N)+1);// wt(Z(N)+1);// }