QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#324701 | #5533. Trick | hotboy2703 | 0 | 851ms | 3720kb | C++14 | 1.6kb | 2024-02-10 23:13:40 | 2024-02-10 23:13:40 |
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*(2*n+5)+y+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 2 12 9
4 2 10 3
*/
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 851ms = 0ms + 851ms
memory: 0kb,3680kb
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:
4 3 3 4 1 3 5 3 1 3 4 0 0 4 2 3 1 3 4 2 0 1 2 3 4 6 3 2 0 1 0 3 0 1 1 6 3 2 3 0 1 5 5 0 6 4 1 2 6 1 5 1 1 6 0 5 0 1 4 5 5 4 6 3 3 1 6 5 4 5 2 5 5 0 2 6 3 0 4 3 0 5 0 4 1 6 6 3 4 6 3 6 2 1 4 6 1 2 0 2 4 0 0 2 3 4 0 7 3 4 2 0 1 5 7 0 2 0 7 2 5 0 1 7 7 1 1 2 0 7 7 1 2 0 4 0 4 2 7 5 3 1 1 4 7 4 4 5 7 0 ...
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:
8 12 10 12 9 10 11 7 6 9 6 12 7 8 11 9 8 5 5 10 11 5 9 5 10 12 7 8 11 10 12 11 4 9 4 7 4 8 4 7 11 10 7 12 3 9 7 11 3 11 8 9 10 9 9 11 10 8 2 9 2 7 8 10 11 8 10 9 2 8 11 8 12 1 9 7 10 8 8 12 10 1 9 11 8 7 12 0 10 0 8 12 12 11 10 8 10 9 11 10 12 8 12 9 8 5 9 5 5 6 10 8 9 6 4 10 6 9 12 6 11 12 10 6 10 ...
input:
12012 3 6 4 3 8 12 6 3 4 10 12 6 1 3 9 10 6 5 3 11 7 6 1 3 6 9 6 4 0 6 12 6 0 4 7 8 6 2 3 11 9 6 1 3 8 5 6 4 2 5 10 6 0 1 11 5 6 2 3 9 5 6 4 6 10 12 6 3 2 7 8 6 0 1 11 10 6 0 3 12 11 6 0 1 4 9 6 1 6 4 7 6 3 2 4 8 6 3 0 4 7 6 1 5 11 10 6 5 0 7 12 6 6 4 3 9 6 1 2 7 11 6 6 1 3 11 6 5 1 8 9 6 1 6 10 9 6...
output:
8 2 2 8 4 10 3 1 2 8 11 9 11 7 3 3 7 8 11 1 1 8 3 10 7 6 10 6 10 9 9 9 10 7 11 8 6 9 5 8 9 0 5 2 6 7 9 0 4 9 3 8 3 5 4 3 0 9 4 2 2 1 2 8 11 1 10 11 2 1 12 7 7 2 6 4 7 11 4 12 0 0 11 7 6 4 7 3 0 9 4 10 10 4 7 2 9 12 5 8 8 9 8 3 7 7 2 8 7 11 12 0 5 7 12 3 2 1 3 1 0 5 4 9 3 10 9 1 0 5 6 3 8 12 7 3 3 9 ...
result:
wrong answer the card you returned is 8, but expected 6 (test case 1)
Subtask #2:
score: 0
Skipped
Subtask #3:
score: 0
Wrong Answer
Test #11:
score: 0
Wrong Answer
time: 838ms = 0ms + 838ms
memory: 0kb,3720kb
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:
10 12 7 12 8 10 1 4 11 8 2 0 11 3 6 4 11 1 6 12 6 0 12 2 1 11 14 13 11 4 0 8 10 6 0 7 2 7 10 5 11 10 6 5 1 3 16 6 2 7 4 2 5 8 15 10 14 6 16 9 4 12 16 3 7 6 8 17 10 8 7 5 5 4 1 4 9 18 1 16 2 5 19 11 1 15 16 0 15 3 12 16 5 1 16 5 7 4 8 3 15 8 9 8 6 5 9 7 8 21 6 22 9 0 0 13 22 20 22 4 12 21 6 4 17 5 10...
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:
5 0 11 2 1 5 0 3 0 7 8 11 5 12 8 9 7 3 3 2 3 11 7 8 4 0 6 4 6 3 1 5 9 4 14 10 10 11 12 3 3 16 0 11 13 2 15 14 11 4 5 11 14 4 9 8 4 0 15 3 1 0 13 15 4 1 6 0 3 11 18 14 12 3 8 10 13 5 13 11 0 18 5 20 17 4 20 8 14 16 17 18 16 13 11 3 19 17 13 20 12 5 18 1 13 0 0 2 10 13 10 21 7 6 17 6 15 9 5 18 14 17 1...
input:
6525 3 6 10 12 5 0 6 7 12 11 2 6 8 10 1 5 6 1 4 0 3 6 11 8 0 7 6 2 0 8 11 6 11 3 5 12 6 6 4 8 9 6 11 1 7 3 6 6 12 3 2 7 6 0 3 11 7 12 2 7 8 7 1 11 4 0 7 14 13 6 4 7 11 4 6 3 7 0 8 1 5 7 10 6 9 4 7 0 7 14 10 7 2 7 10 11 7 10 5 12 3 8 11 10 3 16 8 6 5 0 11 8 1 3 13 2 8 16 6 15 14 8 2 7 11 4 8 4 2 5 11...
output:
6 7 3 9 6 7 5 8 11 6 0 1 13 8 6 11 13 0 0 4 2 14 13 6 16 8 7 16 0 4 16 7 7 12 11 11 4 14 17 14 9 5 10 5 6 0 13 14 4 2 9 22 20 0 20 1 16 7 13 8 18 19 6 9 16 21 19 13 16 14 5 17 3 7 14 22 11 19 17 11 21 21 6 10 18 6 13 14 20 18 16 21 3 6 19 9 15 5 2 12 22 20 10 16 12 5 22 21 4 17 21 15 6 21 21 6 18 17...
result:
wrong answer the card you returned is 6, but expected 7 (test case 1)
Subtask #4:
score: 0
Skipped