QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#324709 | #5533. Trick | hotboy2703 | 0 | 861ms | 3908kb | C++14 | 1.7kb | 2024-02-10 23:16:09 | 2024-02-10 23:16:09 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define pll pair <ll,ll>
#define fi first
#define se second
#define sz(a) (ll((a).size()))
#define BIT(mask,i) (((mask) >> (i))&1LL)
#define MASK(i) (1LL << (i))
mt19937_64 rng(1);
mt19937_64 rng2(chrono::steady_clock::now().time_since_epoch().count());
ll random2(ll l,ll r){
return rng2()%(r-l+1)+l;
}
ll random(ll l,ll r){
return rng()%(r-l+1)+l;
}
ll myrandom(ll i){
return rng()%i;
}
ll f(ll x,ll y,ll n){
rng.seed(((x+1)*(2*n+5)+y+1+69)*45);
return random(0,2*n);
}
int main(){
ios_base::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);
// freopen("trick.in","r",stdin);
// freopen("trick.out","w",stdout);
ll t;
cin>>t;
ll task;
cin>>task;
clock_t s = clock();
while(t--){
ll n;
cin>>n;
if (task==3){
ll a,b,c,d;
cin>>a>>b>>c>>d;
ll res = -(f(a,b,n)+f(c,d,n));
res = (res%(2*n+1)+2*n+1)%(2*n+1);
cout<<res<<'\n';
}
else{
vector <ll> a(n);
ll sum = 0;
for (auto &x:a){cin>>x;sum = (sum+x)%(2*n+1);}
ll u,v;
u = random2(0,sz(a)-1);
v = random2(0,sz(a)-1);
while ((u == v || f(a[u],a[v],n) != sum) && clock() - s < 0.9 * CLOCKS_PER_SEC){
u = random2(0,sz(a)-1);
v = random2(0,sz(a)-1);
}
cout<<a[u]<<' '<<a[v]<<'\n';
}
}
}
/*
1
1
6
7 8 9 10 11 12
1
1
6
0 1 2 3 4 5
1
3
6
11 12 5 4
*/
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 861ms = 0ms + 861ms
memory: 0kb,3908kb
input:
12012 1 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 2 3 4 6 6 0 1 2 3 4 6 6 0 1 2 3 4 6 6 0 1 2 3 4 6 6 0 1 2 3 4 6 6 0 1 2 3 4 6 6 0 1 2 3 4 6 6 0 1 2 3 5 6 6 0 1 2 3 5 6 6 0 1 2 3 5 6 6 0 1 2 3 5 6 6 0 1 2 3 5 6 6 0 1 2 3 5 6 6 0 1 2 3 5 ...
output:
5 4 5 4 5 4 4 5 4 5 4 5 5 4 3 1 0 4 4 2 4 1 4 2 0 4 3 1 6 1 6 1 0 3 0 3 6 1 0 3 6 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 3 6 3 6 3 6 3 6 3 6 3 6 3 6 6 0 2 0 6 0 5 3 2 0 2 0 6 5 4 3 4 6 5 6 5 6 4 6 4 6 4 6 0 3 0 3 0 3 0 3 0 3 0 3 0 3 0 1 0 1 0 1 0 1 0 1 0 1 0 1 4 0 1 2 4 7 2 5 7 0 1 5 7 0 3 5 0 1 0 4 1 3 1 4 ...
input:
12012 2 6 7 8 9 10 11 12 6 6 8 9 10 11 12 6 6 7 9 10 11 12 6 6 7 8 10 11 12 6 6 7 8 9 11 12 6 6 7 8 9 10 12 6 6 7 8 9 10 11 6 7 8 9 10 11 12 6 5 8 9 10 11 12 6 5 7 9 10 11 12 6 5 7 8 10 11 12 6 5 7 8 9 11 12 6 5 7 8 9 10 12 6 5 7 8 9 10 11 6 7 8 9 10 11 12 6 4 8 9 10 11 12 6 4 7 9 10 11 12 6 4 7 8 1...
output:
11 12 8 12 12 6 8 10 8 11 7 6 10 9 12 11 12 11 11 11 12 12 5 5 7 10 10 10 8 8 4 11 7 12 7 8 12 4 8 12 7 7 10 7 9 9 9 11 8 11 3 8 10 3 8 8 12 11 2 12 7 9 8 2 7 2 8 10 2 9 8 10 8 8 7 11 8 7 7 7 7 1 11 10 7 11 0 9 12 11 11 10 11 7 8 0 7 10 8 12 9 10 10 6 10 8 12 9 6 10 8 6 8 6 9 12 12 10 8 10 4 6 9 6 6...
input:
12012 3 6 5 4 11 12 6 5 4 8 12 6 5 4 12 6 6 4 5 8 10 6 4 5 8 11 6 4 5 7 6 6 5 4 10 9 6 3 1 12 11 6 0 4 12 11 6 4 2 11 11 6 4 1 12 12 6 4 2 5 5 6 0 4 7 10 6 3 1 10 10 6 6 1 8 8 6 6 1 4 11 6 0 3 7 12 6 0 3 7 8 6 6 1 12 4 6 0 3 8 12 6 6 1 7 7 6 0 1 10 7 6 0 1 9 9 6 0 1 9 11 6 0 1 8 11 6 0 1 3 8 6 0 1 1...
output:
6 7 8 9 5 2 2 12 12 0 1 4 12 11 3 0 4 11 5 5 0 12 6 4 2 3 0 2 9 11 0 5 12 5 11 4 0 1 9 10 12 9 0 3 7 8 11 9 7 5 5 7 4 2 11 1 0 6 9 6 0 12 5 5 11 8 0 11 11 1 3 5 8 10 12 3 8 4 12 1 2 1 8 8 0 0 7 4 5 6 12 1 11 10 8 2 12 4 12 6 2 0 8 12 0 7 7 9 7 8 9 11 3 12 3 10 7 10 10 8 0 6 8 4 12 1 9 9 10 8 0 1 3 6...
result:
wrong answer the card you returned is 5, but expected 10 (test case 5)
Subtask #2:
score: 0
Skipped
Subtask #3:
score: 0
Wrong Answer
Test #11:
score: 0
Wrong Answer
time: 828ms = 0ms + 828ms
memory: 0kb,3844kb
input:
6525 1 6 10 1 11 3 12 6 6 1 7 10 12 5 6 6 0 10 12 7 9 8 6 12 1 8 4 7 11 6 11 8 9 4 10 6 6 0 7 2 3 4 5 6 0 8 3 10 11 6 6 0 1 2 4 7 6 6 0 1 11 9 5 6 6 7 1 12 8 6 5 7 0 1 13 10 12 5 6 7 0 14 2 3 4 12 6 7 11 1 3 8 12 6 13 7 0 1 2 3 13 5 14 7 11 9 10 8 4 14 7 7 0 8 14 3 4 13 11 7 0 10 2 14 8 5 6 7 0 13 2...
output:
6 1 10 6 7 9 8 12 4 11 3 7 11 3 2 0 11 6 12 5 1 13 2 4 8 12 14 3 14 4 14 11 10 0 7 7 1 3 8 8 14 10 16 16 0 8 4 13 14 15 15 1 1 5 4 0 1 14 9 7 10 12 1 4 17 0 7 4 5 15 7 10 13 17 18 2 7 2 2 16 9 12 18 0 1 14 16 7 15 6 13 12 1 10 16 13 13 5 14 6 18 10 20 7 17 5 8 14 4 16 22 19 20 9 11 12 18 17 17 7 2 1...
input:
6525 2 6 0 2 4 5 8 9 6 2 3 4 8 9 11 6 1 2 3 4 5 11 6 0 3 5 6 9 10 6 0 1 3 5 7 12 6 1 6 8 10 11 12 6 2 4 5 7 9 12 6 5 8 9 10 11 12 6 3 4 7 8 10 12 6 0 2 3 4 9 11 7 2 3 4 7 8 9 11 7 1 5 7 8 9 10 13 7 0 4 5 7 9 10 14 7 4 6 7 8 9 10 11 7 0 1 2 3 5 6 13 7 1 2 5 7 9 10 12 7 1 3 4 9 11 12 13 7 1 3 4 6 10 1...
output:
4 9 11 4 3 2 6 0 7 1 6 1 2 5 5 12 4 7 4 4 7 8 9 8 4 5 7 7 1 13 10 9 4 4 1 3 5 5 12 11 0 2 9 14 10 13 14 7 10 11 0 12 14 12 14 9 0 5 5 10 13 7 0 12 14 4 18 18 16 17 14 14 12 9 11 10 3 6 17 6 15 10 17 8 4 9 11 18 4 14 5 3 16 0 9 3 15 3 9 20 17 2 11 6 0 16 20 11 10 11 10 12 18 17 5 19 9 2 8 19 0 16 18 ...
input:
6525 3 6 6 1 4 9 6 10 6 11 4 6 7 9 3 2 6 8 12 6 0 6 4 11 7 1 6 3 7 6 1 6 11 3 2 5 6 2 0 5 12 6 11 6 4 7 6 12 5 4 4 7 1 13 7 8 7 2 4 9 8 7 8 12 4 5 7 14 3 7 7 7 14 4 1 13 7 14 11 10 9 7 10 0 4 4 7 7 7 1 3 7 1 3 5 5 7 8 8 12 11 8 14 10 0 2 8 16 16 9 14 8 0 8 10 13 8 4 13 14 7 8 14 15 10 11 8 15 1 0 12...
output:
7 0 6 2 10 1 0 5 4 10 4 14 0 11 6 8 4 4 0 0 8 4 7 1 10 5 3 4 14 15 3 9 13 13 5 0 8 7 3 0 4 18 8 4 8 7 16 20 20 1 15 11 17 8 22 19 20 20 2 12 3 19 7 15 21 3 13 10 9 18 3 2 13 18 8 19 22 3 1 12 12 9 10 16 4 13 17 16 12 21 13 8 14 11 5 5 1 1 9 22 2 2 10 9 2 5 21 16 3 21 14 12 4 10 15 18 5 13 0 2 17 11 ...
result:
wrong answer the card you returned is 10, but expected 2 (test case 5)
Subtask #4:
score: 0
Skipped