QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#279642 | #7629. Make SYSU Great Again II | bachbeo2007 | AC ✓ | 178ms | 4020kb | C++23 | 2.6kb | 2023-12-08 22:36:59 | 2023-12-08 22:37:00 |
Judging History
answer
// Judges with GCC >= 12 only needs Ofast
// #pragma GCC optimize("O3,no-stack-protector,fast-math,unroll-loops,tree-vectorize")
// MLE optimization
// #pragma GCC optimize("conserve-stack")
// Old judges
// #pragma GCC target("sse4.2,popcnt,lzcnt,abm,mmx,fma,bmi,bmi2")
// New judges. Test with assert(__builtin_cpu_supports("avx2"));
// #pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2,fma,tune=native")
// Atcoder
// #pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2,fma")
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
- insert(x),erase(x)
- find_by_order(k): return iterator to the k-th smallest element
- order_of_key(x): the number of elements that are strictly smaller
*/
#include<bits/stdc++.h>
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
uniform_real_distribution<> pp(0.0,1.0);
#define int long long
#define ld long double
#define pii pair<int,int>
#define piii pair<pii,int>
#define mpp make_pair
#define fi first
#define se second
const int inf=1e18;
const int mod=998244353;
const int maxn=200005;
const int bl=650;
const int maxs=655;
const int maxm=200005;
const int maxq=1000005;
const int maxl=20;
const int maxa=1000000;
const int root=3;
int power(int a,int n){
int res=1;
while(n){
if(n&1) res=res*a%mod;
a=a*a%mod;n>>=1;
}
return res;
}
const int iroot=power(3,mod-2);
const int base=101;
int gray(int x){
return x^(x>>1);
}
void solve(){
int N;cin >> N;
int n=1;
while(n<N) n<<=1;
vector<int> ans;
for(int i=0;i<n;i++){
int x0=gray(i),x1=(i==n-1?0:gray(i+1));
if(((int)ans.size()&1) == (x1<x0)){
ans.push_back(x0);
ans.push_back(x0);
ans.push_back(x0);
}
else{
ans.push_back(x0);
ans.push_back(x0);
}
}
for(int i=1;i<(int)ans.size();i+=2) ans[i]=(n-1)^ans[i];
map<int,int> mp;
for(int x:ans) mp[x]++;
for(int i=0;i<(int)ans.size();i++){
if(mp[ans[i]]>=4){
mp[ans[i]]=0;
ans.erase(ans.begin()+i);
ans.erase(ans.begin()+i);
}
}
cout << "Yes\n";
for(int i=0;i<N;i++){
for(int j=0;j<N;j++) cout << ans[i+j]*n+ans[n-1+i-j] << ' ';
cout << '\n';
}
}
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);cout.tie(NULL);
int test=1;//cin >> test;
while(test--) solve();
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3700kb
input:
4
output:
Yes 0 9 6 0 11 4 1 14 4 3 12 1 2 12 3 8
result:
ok 1
Test #2:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
1
output:
Yes 0
result:
ok 1
Test #3:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
2
output:
Yes 0 0 1 2
result:
ok 1
Test #4:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
3
output:
Yes 0 9 6 11 4 1 4 3 12
result:
ok 1
Test #5:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
5
output:
Yes 5 50 12 35 28 50 13 34 28 35 9 34 29 34 20 38 25 34 21 42 24 38 17 42 21
result:
ok 1
Test #6:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
8
output:
Yes 5 50 12 35 28 33 22 40 50 13 34 28 35 20 41 22 9 34 29 34 20 43 20 9 38 25 34 21 42 20 11 52 24 38 17 42 21 10 52 3 39 16 46 17 10 53 2 60 16 47 16 14 49 2 61 2 45 16 15 48 6 57 2 45
result:
ok 1
Test #7:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
13
output:
Yes 10 229 24 199 56 198 41 210 45 146 108 131 124 228 26 197 56 199 40 214 41 146 109 130 124 131 19 196 58 197 40 215 40 150 105 130 125 130 92 204 51 196 42 213 40 151 104 134 121 130 93 162 50 204 35 212 42 149 104 135 120 134 89 162 77 205 34 220 35 148 106 133 120 135 88 166 73 50 32 221...
result:
ok 1
Test #8:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
21
output:
Yes 22 969 52 906 117 906 81 942 80 815 208 781 242 780 179 836 154 613 408 583 440 968 54 905 116 906 85 938 81 814 208 783 240 781 178 844 147 612 410 581 440 519 39 904 118 905 84 938 85 810 209 782 240 783 176 845 146 620 403 580 442 517 504 920 103 904 86 937 84 810 213 778 241 782 176 847 1...
result:
ok 1
Test #9:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
34
output:
Yes 46 3985 108 3859 236 3858 173 3922 169 3670 424 3605 490 3604 355 3740 290 3293 800 3231 864 3102 993 3098 933 3162 676 3417 678 3352 615 3464 566 2505 3984 110 3857 236 3859 172 3922 173 3666 425 3606 488 3605 362 3732 291 3292 802 3229 864 3103 992 3102 929 3162 677 3418 676 3353 614 3480 551...
result:
ok 1
Test #10:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
55
output:
Yes 46 3985 108 3859 236 3858 173 3922 169 3670 424 3605 490 3604 355 3740 290 3293 800 3231 864 3102 993 3098 933 3162 676 3417 678 3352 615 3464 566 2505 1588 2442 1653 2314 1713 2382 1712 2127 1968 2061 2034 2060 1907 2180 1850 2245 1336 2695 1400 2566 1465 3984 110 3857 236 3859 172 3922 173 36...
result:
ok 1
Test #11:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
89
output:
Yes 94 16161 220 15907 476 15906 349 16034 345 15526 856 15399 984 15397 730 15652 595 14764 1618 14637 1744 14382 2001 14378 1877 14506 1364 15017 1366 14888 1223 15160 1094 13241 3140 13114 3269 12858 3393 12990 3392 12479 3904 12349 4034 12348 3779 12596 3658 12725 2632 13622 2761 13362 2893 1349...
result:
ok 1
Test #12:
score: 0
Accepted
time: 1ms
memory: 3724kb
input:
100
output:
Yes 94 16161 220 15907 476 15906 349 16034 345 15526 856 15399 984 15397 730 15652 595 14764 1618 14637 1744 14382 2001 14378 1877 14506 1364 15017 1366 14888 1223 15160 1094 13241 3140 13114 3269 12858 3393 12990 3392 12479 3904 12349 4034 12348 3779 12596 3658 12725 2632 13622 2761 13362 2893 1349...
result:
ok 1
Test #13:
score: 0
Accepted
time: 2ms
memory: 3608kb
input:
200
output:
Yes 190 65089 444 64579 956 64578 701 64834 697 63814 1720 63559 1976 63557 1466 64068 1203 62284 3250 62029 3504 61519 4016 61518 3761 61770 2741 62794 2740 62537 2486 63048 2215 59224 6310 58969 6564 58458 6821 58714 6817 57694 7840 57437 8098 57436 7587 57940 7338 58197 5288 59990 5545 59474 5805...
result:
ok 1
Test #14:
score: 0
Accepted
time: 2ms
memory: 3928kb
input:
300
output:
Yes 382 261249 892 260227 1916 260226 1405 260738 1401 258694 3448 258183 3960 258181 2938 259204 2419 255628 6514 255117 7024 254095 8048 254094 7537 254602 5493 256650 5492 256137 4982 257160 4455 249496 12646 248985 13156 247962 13669 248474 13665 246430 15712 245919 16224 245917 15202 246940 146...
result:
ok 1
Test #15:
score: 0
Accepted
time: 8ms
memory: 3760kb
input:
400
output:
Yes 382 261249 892 260227 1916 260226 1405 260738 1401 258694 3448 258183 3960 258181 2938 259204 2419 255628 6514 255117 7024 254095 8048 254094 7537 254602 5493 256650 5492 256137 4982 257160 4455 249496 12646 248985 13156 247962 13669 248474 13665 246430 15712 245919 16224 245917 15202 246940 146...
result:
ok 1
Test #16:
score: 0
Accepted
time: 8ms
memory: 3896kb
input:
500
output:
Yes 382 261249 892 260227 1916 260226 1405 260738 1401 258694 3448 258183 3960 258181 2938 259204 2419 255628 6514 255117 7024 254095 8048 254094 7537 254602 5493 256650 5492 256137 4982 257160 4455 249496 12646 248985 13156 247962 13669 248474 13665 246430 15712 245919 16224 245917 15202 246940 146...
result:
ok 1
Test #17:
score: 0
Accepted
time: 18ms
memory: 3896kb
input:
600
output:
Yes 766 1046785 1788 1044739 3836 1044738 2813 1045762 2809 1041670 6904 1040647 7928 1040645 5882 1042692 4851 1035532 13042 1034509 14064 1032463 16112 1032462 15089 1033482 10997 1037578 10996 1036553 9974 1038600 8935 1023256 25318 1022233 26340 1020186 27365 1021210 27361 1017118 31456 1016095 ...
result:
ok 1
Test #18:
score: 0
Accepted
time: 21ms
memory: 3936kb
input:
700
output:
Yes 766 1046785 1788 1044739 3836 1044738 2813 1045762 2809 1041670 6904 1040647 7928 1040645 5882 1042692 4851 1035532 13042 1034509 14064 1032463 16112 1032462 15089 1033482 10997 1037578 10996 1036553 9974 1038600 8935 1023256 25318 1022233 26340 1020186 27365 1021210 27361 1017118 31456 1016095 ...
result:
ok 1
Test #19:
score: 0
Accepted
time: 26ms
memory: 3968kb
input:
800
output:
Yes 766 1046785 1788 1044739 3836 1044738 2813 1045762 2809 1041670 6904 1040647 7928 1040645 5882 1042692 4851 1035532 13042 1034509 14064 1032463 16112 1032462 15089 1033482 10997 1037578 10996 1036553 9974 1038600 8935 1023256 25318 1022233 26340 1020186 27365 1021210 27361 1017118 31456 1016095 ...
result:
ok 1
Test #20:
score: 0
Accepted
time: 34ms
memory: 3736kb
input:
900
output:
Yes 766 1046785 1788 1044739 3836 1044738 2813 1045762 2809 1041670 6904 1040647 7928 1040645 5882 1042692 4851 1035532 13042 1034509 14064 1032463 16112 1032462 15089 1033482 10997 1037578 10996 1036553 9974 1038600 8935 1023256 25318 1022233 26340 1020186 27365 1021210 27361 1017118 31456 1016095 ...
result:
ok 1
Test #21:
score: 0
Accepted
time: 43ms
memory: 3736kb
input:
1000
output:
Yes 766 1046785 1788 1044739 3836 1044738 2813 1045762 2809 1041670 6904 1040647 7928 1040645 5882 1042692 4851 1035532 13042 1034509 14064 1032463 16112 1032462 15089 1033482 10997 1037578 10996 1036553 9974 1038600 8935 1023256 25318 1022233 26340 1020186 27365 1021210 27361 1017118 31456 1016095 ...
result:
ok 1
Test #22:
score: 0
Accepted
time: 65ms
memory: 4020kb
input:
1200
output:
Yes 1534 4190721 3580 4186627 7676 4186626 5629 4188674 5625 4180486 13816 4178439 15864 4178437 11770 4182532 9715 4168204 26098 4166157 28144 4162063 32240 4162062 30193 4164106 22005 4172298 22004 4170249 19958 4174344 17895 4143640 50662 4141593 52708 4137498 54757 4139546 54753 4131358 62944 41...
result:
ok 1
Test #23:
score: 0
Accepted
time: 84ms
memory: 3764kb
input:
1400
output:
Yes 1534 4190721 3580 4186627 7676 4186626 5629 4188674 5625 4180486 13816 4178439 15864 4178437 11770 4182532 9715 4168204 26098 4166157 28144 4162063 32240 4162062 30193 4164106 22005 4172298 22004 4170249 19958 4174344 17895 4143640 50662 4141593 52708 4137498 54757 4139546 54753 4131358 62944 41...
result:
ok 1
Test #24:
score: 0
Accepted
time: 109ms
memory: 3816kb
input:
1600
output:
Yes 1534 4190721 3580 4186627 7676 4186626 5629 4188674 5625 4180486 13816 4178439 15864 4178437 11770 4182532 9715 4168204 26098 4166157 28144 4162063 32240 4162062 30193 4164106 22005 4172298 22004 4170249 19958 4174344 17895 4143640 50662 4141593 52708 4137498 54757 4139546 54753 4131358 62944 41...
result:
ok 1
Test #25:
score: 0
Accepted
time: 144ms
memory: 3816kb
input:
1800
output:
Yes 1534 4190721 3580 4186627 7676 4186626 5629 4188674 5625 4180486 13816 4178439 15864 4178437 11770 4182532 9715 4168204 26098 4166157 28144 4162063 32240 4162062 30193 4164106 22005 4172298 22004 4170249 19958 4174344 17895 4143640 50662 4141593 52708 4137498 54757 4139546 54753 4131358 62944 41...
result:
ok 1
Test #26:
score: 0
Accepted
time: 172ms
memory: 3884kb
input:
1900
output:
Yes 1534 4190721 3580 4186627 7676 4186626 5629 4188674 5625 4180486 13816 4178439 15864 4178437 11770 4182532 9715 4168204 26098 4166157 28144 4162063 32240 4162062 30193 4164106 22005 4172298 22004 4170249 19958 4174344 17895 4143640 50662 4141593 52708 4137498 54757 4139546 54753 4131358 62944 41...
result:
ok 1
Test #27:
score: 0
Accepted
time: 169ms
memory: 3820kb
input:
1920
output:
Yes 1534 4190721 3580 4186627 7676 4186626 5629 4188674 5625 4180486 13816 4178439 15864 4178437 11770 4182532 9715 4168204 26098 4166157 28144 4162063 32240 4162062 30193 4164106 22005 4172298 22004 4170249 19958 4174344 17895 4143640 50662 4141593 52708 4137498 54757 4139546 54753 4131358 62944 41...
result:
ok 1
Test #28:
score: 0
Accepted
time: 178ms
memory: 3792kb
input:
2000
output:
Yes 1534 4190721 3580 4186627 7676 4186626 5629 4188674 5625 4180486 13816 4178439 15864 4178437 11770 4182532 9715 4168204 26098 4166157 28144 4162063 32240 4162062 30193 4164106 22005 4172298 22004 4170249 19958 4174344 17895 4143640 50662 4141593 52708 4137498 54757 4139546 54753 4131358 62944 41...
result:
ok 1
Test #29:
score: 0
Accepted
time: 1ms
memory: 3600kb
input:
62
output:
Yes 46 3985 108 3859 236 3858 173 3922 169 3670 424 3605 490 3604 355 3740 290 3293 800 3231 864 3102 993 3098 933 3162 676 3417 678 3352 615 3464 566 2505 1588 2442 1653 2314 1713 2382 1712 2127 1968 2061 2034 2060 1907 2180 1850 2245 1336 2695 1400 2566 1465 2626 1213 2882 1212 2819 1276 2817 398...
result:
ok 1
Test #30:
score: 0
Accepted
time: 1ms
memory: 3672kb
input:
130
output:
Yes 190 65089 444 64579 956 64578 701 64834 697 63814 1720 63559 1976 63557 1466 64068 1203 62284 3250 62029 3504 61519 4016 61518 3761 61770 2741 62794 2740 62537 2486 63048 2215 59224 6310 58969 6564 58458 6821 58714 6817 57694 7840 57437 8098 57436 7587 57940 7338 58197 5288 59990 5545 59474 5805...
result:
ok 1
Test #31:
score: 0
Accepted
time: 1ms
memory: 3664kb
input:
126
output:
Yes 94 16161 220 15907 476 15906 349 16034 345 15526 856 15399 984 15397 730 15652 595 14764 1618 14637 1744 14382 2001 14378 1877 14506 1364 15017 1366 14888 1223 15160 1094 13241 3140 13114 3269 12858 3393 12990 3392 12479 3904 12349 4034 12348 3779 12596 3658 12725 2632 13622 2761 13362 2893 1349...
result:
ok 1
Test #32:
score: 0
Accepted
time: 1ms
memory: 3632kb
input:
66
output:
Yes 94 16161 220 15907 476 15906 349 16034 345 15526 856 15399 984 15397 730 15652 595 14764 1618 14637 1744 14382 2001 14378 1877 14506 1364 15017 1366 14888 1223 15160 1094 13241 3140 13114 3269 12858 3393 12990 3392 12479 3904 12349 4034 12348 3779 12596 3658 12725 2632 13622 2761 13362 2893 1349...
result:
ok 1
Test #33:
score: 0
Accepted
time: 40ms
memory: 3768kb
input:
1021
output:
Yes 766 1046785 1788 1044739 3836 1044738 2813 1045762 2809 1041670 6904 1040647 7928 1040645 5882 1042692 4851 1035532 13042 1034509 14064 1032463 16112 1032462 15089 1033482 10997 1037578 10996 1036553 9974 1038600 8935 1023256 25318 1022233 26340 1020186 27365 1021210 27361 1017118 31456 1016095 ...
result:
ok 1
Test #34:
score: 0
Accepted
time: 45ms
memory: 3736kb
input:
1022
output:
Yes 766 1046785 1788 1044739 3836 1044738 2813 1045762 2809 1041670 6904 1040647 7928 1040645 5882 1042692 4851 1035532 13042 1034509 14064 1032463 16112 1032462 15089 1033482 10997 1037578 10996 1036553 9974 1038600 8935 1023256 25318 1022233 26340 1020186 27365 1021210 27361 1017118 31456 1016095 ...
result:
ok 1
Test #35:
score: 0
Accepted
time: 46ms
memory: 3972kb
input:
1023
output:
Yes 766 1046785 1788 1044739 3836 1044738 2813 1045762 2809 1041670 6904 1040647 7928 1040645 5882 1042692 4851 1035532 13042 1034509 14064 1032463 16112 1032462 15089 1033482 10997 1037578 10996 1036553 9974 1038600 8935 1023256 25318 1022233 26340 1020186 27365 1021210 27361 1017118 31456 1016095 ...
result:
ok 1
Test #36:
score: 0
Accepted
time: 41ms
memory: 3732kb
input:
1024
output:
Yes 766 1046785 1788 1044739 3836 1044738 2813 1045762 2809 1041670 6904 1040647 7928 1040645 5882 1042692 4851 1035532 13042 1034509 14064 1032463 16112 1032462 15089 1033482 10997 1037578 10996 1036553 9974 1038600 8935 1023256 25318 1022233 26340 1020186 27365 1021210 27361 1017118 31456 1016095 ...
result:
ok 1
Test #37:
score: 0
Accepted
time: 46ms
memory: 4016kb
input:
1025
output:
Yes 1534 4190721 3580 4186627 7676 4186626 5629 4188674 5625 4180486 13816 4178439 15864 4178437 11770 4182532 9715 4168204 26098 4166157 28144 4162063 32240 4162062 30193 4164106 22005 4172298 22004 4170249 19958 4174344 17895 4143640 50662 4141593 52708 4137498 54757 4139546 54753 4131358 62944 41...
result:
ok 1
Test #38:
score: 0
Accepted
time: 43ms
memory: 3820kb
input:
1026
output:
Yes 1534 4190721 3580 4186627 7676 4186626 5629 4188674 5625 4180486 13816 4178439 15864 4178437 11770 4182532 9715 4168204 26098 4166157 28144 4162063 32240 4162062 30193 4164106 22005 4172298 22004 4170249 19958 4174344 17895 4143640 50662 4141593 52708 4137498 54757 4139546 54753 4131358 62944 41...
result:
ok 1
Test #39:
score: 0
Accepted
time: 58ms
memory: 3820kb
input:
1027
output:
Yes 1534 4190721 3580 4186627 7676 4186626 5629 4188674 5625 4180486 13816 4178439 15864 4178437 11770 4182532 9715 4168204 26098 4166157 28144 4162063 32240 4162062 30193 4164106 22005 4172298 22004 4170249 19958 4174344 17895 4143640 50662 4141593 52708 4137498 54757 4139546 54753 4131358 62944 41...
result:
ok 1
Extra Test:
score: 0
Extra Test Passed