QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#377911#2554. AND PLUS ORwilly109RE 311ms3728kbC++201.0kb2024-04-05 20:10:032024-04-05 20:10:04

Judging History

你现在查看的是最新测评结果

  • [2024-04-05 20:10:04]
  • 评测
  • 测评结果:RE
  • 用时:311ms
  • 内存:3728kb
  • [2024-04-05 20:10:03]
  • 提交

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
*/

详细

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

output:


result: