# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
102006 | 2019-03-21T13:08:04 Z | Nicholas_Patrick | Bali Sculptures (APIO15_sculpture) | C++17 | 1000 ms | 512 KB |
#include <bits/stdc++.h> using namespace std; int n, a, b; vector <long long> y, psy; int checkPossibility(long long x, long long toDeduct=0, int checkFrom=0){ if(checkFrom==n) return 0; int ret=n; for(int i = checkFrom;i < n;i ++){ if(((psy[i]-toDeduct)|x)==x) ret=min(ret, checkPossibility(x, psy[i], i+1)); if(psy[i]-toDeduct>x) break; } return ret+1; } int main(){ scanf("%d %d %d", &n, &a, &b); y.resize(n); psy.resize(n); for(int i = 0;i < n;i ++) scanf("%lld", &y[i]); psy[0]=y[0]; for(int i = 1;i < n;i ++) psy[i]=psy[i-1]+y[i]; if(a==1){ long long lo=0x0 , hi=0x20000000000, mi; while(true){ if(checkPossibility(lo)<=b)break; lo++; } printf("%lld\n", lo); }else{ } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 256 KB | Output is correct |
4 | Correct | 2 ms | 384 KB | Output is correct |
5 | Correct | 3 ms | 384 KB | Output is correct |
6 | Correct | 2 ms | 384 KB | Output is correct |
7 | Correct | 3 ms | 384 KB | Output is correct |
8 | Correct | 8 ms | 384 KB | Output is correct |
9 | Correct | 10 ms | 384 KB | Output is correct |
10 | Correct | 16 ms | 400 KB | Output is correct |
11 | Correct | 41 ms | 256 KB | Output is correct |
12 | Correct | 4 ms | 384 KB | Output is correct |
13 | Correct | 3 ms | 384 KB | Output is correct |
14 | Incorrect | 3 ms | 256 KB | Output isn't correct |
15 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 512 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 256 KB | Output is correct |
4 | Correct | 2 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Correct | 2 ms | 384 KB | Output is correct |
7 | Correct | 3 ms | 256 KB | Output is correct |
8 | Correct | 8 ms | 256 KB | Output is correct |
9 | Correct | 10 ms | 384 KB | Output is correct |
10 | Correct | 25 ms | 384 KB | Output is correct |
11 | Correct | 41 ms | 356 KB | Output is correct |
12 | Correct | 4 ms | 384 KB | Output is correct |
13 | Correct | 2 ms | 368 KB | Output is correct |
14 | Incorrect | 2 ms | 384 KB | Output isn't correct |
15 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 3 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 3 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 256 KB | Output is correct |
6 | Correct | 4 ms | 384 KB | Output is correct |
7 | Correct | 3 ms | 384 KB | Output is correct |
8 | Correct | 7 ms | 256 KB | Output is correct |
9 | Correct | 10 ms | 356 KB | Output is correct |
10 | Correct | 20 ms | 256 KB | Output is correct |
11 | Correct | 42 ms | 384 KB | Output is correct |
12 | Correct | 4 ms | 256 KB | Output is correct |
13 | Correct | 3 ms | 256 KB | Output is correct |
14 | Correct | 3 ms | 256 KB | Output is correct |
15 | Correct | 5 ms | 256 KB | Output is correct |
16 | Execution timed out | 1070 ms | 256 KB | Time limit exceeded |
17 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 256 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
5 | Correct | 2 ms | 256 KB | Output is correct |
6 | Correct | 3 ms | 256 KB | Output is correct |
7 | Correct | 3 ms | 256 KB | Output is correct |
8 | Correct | 7 ms | 256 KB | Output is correct |
9 | Correct | 14 ms | 384 KB | Output is correct |
10 | Correct | 17 ms | 256 KB | Output is correct |
11 | Correct | 45 ms | 384 KB | Output is correct |
12 | Correct | 5 ms | 384 KB | Output is correct |
13 | Correct | 2 ms | 384 KB | Output is correct |
14 | Incorrect | 2 ms | 384 KB | Output isn't correct |
15 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 384 KB | Output is correct |
2 | Correct | 3 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 3 ms | 256 KB | Output is correct |
5 | Correct | 3 ms | 384 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Correct | 3 ms | 384 KB | Output is correct |
8 | Correct | 8 ms | 256 KB | Output is correct |
9 | Correct | 10 ms | 384 KB | Output is correct |
10 | Correct | 16 ms | 384 KB | Output is correct |
11 | Correct | 45 ms | 384 KB | Output is correct |
12 | Correct | 5 ms | 364 KB | Output is correct |
13 | Correct | 2 ms | 384 KB | Output is correct |
14 | Execution timed out | 1073 ms | 384 KB | Time limit exceeded |
15 | Halted | 0 ms | 0 KB | - |