QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#29602 | #2554. AND PLUS OR | AK_Dream | TL | 0ms | 0kb | C++ | 348b | 2022-04-21 16:23:03 | 2022-04-28 15:25:15 |
Judging History
answer
#include <bits/stdc++.h>
#define N 1200005
using namespace std;
int n, a[N];
int main() {
mt19937 rnd(time(0));
scanf("%d", &n); n = 1<<n;
for (int i = 0; i < n; i++) scanf("%d", &a[i]);
while (1) {
int x, y;
x = rnd()%n, y = rnd()%n;
if (a[x]+a[y] < a[x&y]+a[x|y]) {
printf("%d %d\n", x, y);
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Time Limit Exceeded
input:
2 0 1 1 2