# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
433110 | 2021-06-18T20:59:41 Z | peuch | 비스킷 담기 (IOI20_biscuits) | C++17 | 1000 ms | 63216 KB |
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; vector<map<long long, long long> > dp; vector<long long> v(60); long long X; long long getDP(int bit, long long cnt){ cnt += v[bit]; if(bit == 60) return 1; if(dp[bit][cnt] != 0) return dp[bit][cnt]; dp[bit][cnt] = getDP(bit + 1, cnt / 2); if(cnt >= X) dp[bit][cnt] += getDP(bit + 1, (cnt - X) / 2); return dp[bit][cnt]; } long long sub1(long long x, vector<long long> a){ long long ini = 0; long long ans = 1; for(ini = 0; ini < 60;){ long long fim = ini; long long sobra = 0; long long num = 0; long long cnt = 0; while(fim < 60){ long long val = 0; if(fim < a.size()) val = a[fim]; long long tot = val + sobra; sobra = tot / 2; if(tot % 2 == 1) num |= (1LL << cnt); fim++; cnt++; if(sobra == 0) break; } ans *= num + 1; ini = fim; } return ans; } long long count_tastiness(long long x, vector<long long> a) { if(x == 1) return sub1(x, a); X = x; v = vector<long long> (60, 0); dp = vector<map<long long, long long> > (60); for(int i = 0; i < a.size(); i++) v[i] = a[i]; return getDP(0, 0); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 1 ms | 332 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 204 KB | Output is correct |
6 | Correct | 1 ms | 204 KB | Output is correct |
7 | Correct | 1 ms | 204 KB | Output is correct |
8 | Correct | 1 ms | 204 KB | Output is correct |
9 | Correct | 1 ms | 204 KB | Output is correct |
10 | Correct | 1 ms | 204 KB | Output is correct |
11 | Correct | 0 ms | 204 KB | Output is correct |
12 | Correct | 1 ms | 204 KB | Output is correct |
13 | Correct | 1 ms | 204 KB | Output is correct |
14 | Correct | 2 ms | 332 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 1 ms | 280 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 204 KB | Output is correct |
6 | Correct | 1 ms | 204 KB | Output is correct |
7 | Correct | 1 ms | 204 KB | Output is correct |
8 | Correct | 1 ms | 204 KB | Output is correct |
9 | Correct | 1 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 246 ms | 21956 KB | Output is correct |
2 | Correct | 553 ms | 11200 KB | Output is correct |
3 | Correct | 884 ms | 17948 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 204 KB | Output is correct |
6 | Correct | 1 ms | 204 KB | Output is correct |
7 | Correct | 1 ms | 204 KB | Output is correct |
8 | Execution timed out | 1095 ms | 22440 KB | Time limit exceeded |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1099 ms | 63216 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 1 ms | 332 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 204 KB | Output is correct |
6 | Correct | 1 ms | 204 KB | Output is correct |
7 | Correct | 1 ms | 204 KB | Output is correct |
8 | Correct | 1 ms | 204 KB | Output is correct |
9 | Correct | 1 ms | 204 KB | Output is correct |
10 | Correct | 1 ms | 204 KB | Output is correct |
11 | Correct | 0 ms | 204 KB | Output is correct |
12 | Correct | 1 ms | 204 KB | Output is correct |
13 | Correct | 1 ms | 204 KB | Output is correct |
14 | Correct | 2 ms | 332 KB | Output is correct |
15 | Correct | 1 ms | 204 KB | Output is correct |
16 | Correct | 1 ms | 204 KB | Output is correct |
17 | Correct | 1 ms | 280 KB | Output is correct |
18 | Correct | 1 ms | 204 KB | Output is correct |
19 | Correct | 1 ms | 204 KB | Output is correct |
20 | Correct | 1 ms | 204 KB | Output is correct |
21 | Correct | 1 ms | 204 KB | Output is correct |
22 | Correct | 1 ms | 204 KB | Output is correct |
23 | Correct | 1 ms | 204 KB | Output is correct |
24 | Correct | 246 ms | 21956 KB | Output is correct |
25 | Correct | 553 ms | 11200 KB | Output is correct |
26 | Correct | 884 ms | 17948 KB | Output is correct |
27 | Correct | 1 ms | 204 KB | Output is correct |
28 | Correct | 1 ms | 204 KB | Output is correct |
29 | Correct | 1 ms | 204 KB | Output is correct |
30 | Correct | 1 ms | 204 KB | Output is correct |
31 | Execution timed out | 1095 ms | 22440 KB | Time limit exceeded |
32 | Halted | 0 ms | 0 KB | - |