QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#377911 | #2554. AND PLUS OR | willy109 | RE | 311ms | 3728kb | C++20 | 1.0kb | 2024-04-05 20:10:03 | 2024-04-05 20:10:04 |
Judging History
answer
#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2")
#define pb push_back
#define F first
#define S second
#define ld long double
#define all(a) a.begin(),a.end()
#define pii pair <int,int>
#define sz(v) (int)v.size()
#define rep(i , a , b) for(int i=a;i <= (b);i++)
#define per(i , a , b) for(int i=a;i >= (b);i--)
#define deb(x) cout <<#x << " : " << x << "\n" ;
using namespace std ;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int maxn = 2e6 + 10, sq = 1e5 , lg = 19, inf = 1e8+10 , mod = 998244353;
int a[maxn] ;
signed main(){
ios_base::sync_with_stdio(false);cin.tie(0);
int n;cin >> n ;
n = (1<<n) - 1 ;
rep(i , 0 , n){
cin >> a[i] ;
}
int t = 5e7 ;
while(t--){
int i = rng()%n , j =rng()%n ;
if(a[i]+a[j] < a[i&j]+a[i|j]){
cout << i << " " << j << "\n";exit(0) ;
}
}
cout << "-1\n" ;
return 0;
}
/*
10 7 4
8 4
9 4
7 2
10 2
4 5
3 5
6 7
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 311ms
memory: 3728kb
input:
2 0 1 1 2
output:
-1
result:
ok Correct
Test #2:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
2 0 1 1 3
output:
1 2
result:
ok Correct
Test #3:
score: -100
Runtime Error
input:
0 100