QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#135033 | #6641. XOR Dice | wtn135687# | AC ✓ | 1ms | 3720kb | C++14 | 1.8kb | 2023-08-05 10:47:08 | 2023-08-05 10:47:10 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
const int N = 1e6+10,mo = 1e9+7;
int a[N];
array<int,6>R;
bool check(array<int,6>res,int d){
sort(res.begin(),res.end());
for(int i=0;i<5;i++)if(res[i]==res[i+1])return 0;
for(int s=0;s<(1<<6);s++){
int k=0;
for(int i=0;i<6;i++)if(s&(1<<i))k^=res[i];
if(k%d!=0)return 0;
}
return 1;
}
array<int,6>fuck(int d){
array<int,6>res;
res[0]=d;res[1]=d<<6;res[2]=d<<12;
res[3]=d|(d<<6);res[4]=d|(d<<12);res[5]=d|(d<<6)|(d<<12);
assert(check(res,d));
return res;
}int n,d;
// map<array<int,6>,int>mp;
// int kk=0;
// void get(){
// while(true){
// int k=rand()%100000;
// array<int,6>res=R;
// for(int i=0;i<6;i++){
// res[i]^=k;
// }
// sort(res.begin(),res.end());
// if(!mp[res]){
// for(int i=0;i<6;i++)cout<<res[i]<<" \n"[i==5];
// mp[res]=1;
// kk^=k;
// assert(check(res,d));
// break;
// }
// }
// }
// void getend(){
// int k=kk;
// array<int,6>res=R;
// for(int i=0;i<6;i++){
// res[i]^=k;
// }
// sort(res.begin(),res.end());
// assert(!mp[res]);
// assert(check(res,d));
// for(int i=0;i<6;i++)cout<<res[i]<<" \n"[i==5];
// }
inline void solve(){
cin>>n>>d;
R=fuck(d);
// for(int i=0;i<n-1;i++)get();
// getend();
for(int i=0;i<n;i++)for(int j=0;j<6;j++)cout<<R[j]<<" \n"[j==6];
}
signed main(){
srand(time(NULL));
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
int WTN666=1;//cin>>WTN666;
while(WTN666--){
solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3544kb
input:
3 2
output:
2 128 8192 130 8194 8322 2 128 8192 130 8194 8322 2 128 8192 130 8194 8322
result:
ok Correct answer
Test #2:
score: 0
Accepted
time: 1ms
memory: 3504kb
input:
100 60
output:
60 3840 245760 3900 245820 249660 60 3840 245760 3900 245820 249660 60 3840 245760 3900 245820 249660 60 3840 245760 3900 245820 249660 60 3840 245760 3900 245820 249660 60 3840 245760 3900 245820 249660 60 3840 245760 3900 245820 249660 60 3840 245760 3900 245820 249660 60 3840 245760 3900 245820 2...
result:
ok Correct answer
Test #3:
score: 0
Accepted
time: 1ms
memory: 3528kb
input:
99 2
output:
2 128 8192 130 8194 8322 2 128 8192 130 8194 8322 2 128 8192 130 8194 8322 2 128 8192 130 8194 8322 2 128 8192 130 8194 8322 2 128 8192 130 8194 8322 2 128 8192 130 8194 8322 2 128 8192 130 8194 8322 2 128 8192 130 8194 8322 2 128 8192 130 8194 8322 2 128 8192 130 8194 8322 2 128 8192 130 8194 8322 ...
result:
ok Correct answer
Test #4:
score: 0
Accepted
time: 1ms
memory: 3480kb
input:
99 59
output:
59 3776 241664 3835 241723 245499 59 3776 241664 3835 241723 245499 59 3776 241664 3835 241723 245499 59 3776 241664 3835 241723 245499 59 3776 241664 3835 241723 245499 59 3776 241664 3835 241723 245499 59 3776 241664 3835 241723 245499 59 3776 241664 3835 241723 245499 59 3776 241664 3835 241723 2...
result:
ok Correct answer
Test #5:
score: 0
Accepted
time: 1ms
memory: 3544kb
input:
93 17
output:
17 1088 69632 1105 69649 70737 17 1088 69632 1105 69649 70737 17 1088 69632 1105 69649 70737 17 1088 69632 1105 69649 70737 17 1088 69632 1105 69649 70737 17 1088 69632 1105 69649 70737 17 1088 69632 1105 69649 70737 17 1088 69632 1105 69649 70737 17 1088 69632 1105 69649 70737 17 1088 69632 1105 69...
result:
ok Correct answer
Test #6:
score: 0
Accepted
time: 1ms
memory: 3480kb
input:
100 49
output:
49 3136 200704 3185 200753 203889 49 3136 200704 3185 200753 203889 49 3136 200704 3185 200753 203889 49 3136 200704 3185 200753 203889 49 3136 200704 3185 200753 203889 49 3136 200704 3185 200753 203889 49 3136 200704 3185 200753 203889 49 3136 200704 3185 200753 203889 49 3136 200704 3185 200753 2...
result:
ok Correct answer
Test #7:
score: 0
Accepted
time: 1ms
memory: 3532kb
input:
100 5
output:
5 320 20480 325 20485 20805 5 320 20480 325 20485 20805 5 320 20480 325 20485 20805 5 320 20480 325 20485 20805 5 320 20480 325 20485 20805 5 320 20480 325 20485 20805 5 320 20480 325 20485 20805 5 320 20480 325 20485 20805 5 320 20480 325 20485 20805 5 320 20480 325 20485 20805 5 320 20480 325 2048...
result:
ok Correct answer
Test #8:
score: 0
Accepted
time: 1ms
memory: 3640kb
input:
1 57
output:
57 3648 233472 3705 233529 237177
result:
ok Correct answer
Test #9:
score: 0
Accepted
time: 1ms
memory: 3520kb
input:
1 22
output:
22 1408 90112 1430 90134 91542
result:
ok Correct answer
Test #10:
score: 0
Accepted
time: 1ms
memory: 3524kb
input:
1 60
output:
60 3840 245760 3900 245820 249660
result:
ok Correct answer
Test #11:
score: 0
Accepted
time: 1ms
memory: 3544kb
input:
1 2
output:
2 128 8192 130 8194 8322
result:
ok Correct answer
Test #12:
score: 0
Accepted
time: 1ms
memory: 3720kb
input:
10 24
output:
24 1536 98304 1560 98328 99864 24 1536 98304 1560 98328 99864 24 1536 98304 1560 98328 99864 24 1536 98304 1560 98328 99864 24 1536 98304 1560 98328 99864 24 1536 98304 1560 98328 99864 24 1536 98304 1560 98328 99864 24 1536 98304 1560 98328 99864 24 1536 98304 1560 98328 99864 24 1536 98304 1560 98...
result:
ok Correct answer