Submission #993359
Source Code Expand
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define fi first #define se second #define mp make_pair #define pb push_back #define N 200010 int n, m; int a[N]; int f[N]; ll s[N]; int main() { cin >> n; for (int i = 0; i < n-1; i ++) cin >> a[i]; cin >> m; cin >> a[n-1]; s[0] = 0; for (int i = 0; i < n; i ++) s[i+1] = s[i] + a[i]; ll mi = s[n]; for (int i = n-1; i >= 2; i--) { mi = min(mi, s[i]*2-mi); } cout << s[1]*2-mi << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | H - Tokaido |
User | sevenkplus |
Language | C++14 (GCC 5.4.1) |
Score | 700 |
Code Size | 514 Byte |
Status | WA |
Exec Time | 48 ms |
Memory | 2560 KB |
Judge Result
Set Name | sample | dataset1 | dataset2 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 700 / 700 | 0 / 900 | ||||||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
sample | sample-01.txt, sample-02.txt |
dataset1 | sample-01.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt |
dataset2 | sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt, 02-09.txt, 02-10.txt, 02-11.txt, 02-12.txt, 02-13.txt, 02-14.txt, 02-15.txt, 02-16.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | AC | 45 ms | 2560 KB |
01-02.txt | AC | 3 ms | 256 KB |
01-03.txt | AC | 3 ms | 256 KB |
01-04.txt | AC | 25 ms | 1408 KB |
01-05.txt | AC | 46 ms | 2560 KB |
01-06.txt | AC | 46 ms | 2560 KB |
01-07.txt | AC | 16 ms | 896 KB |
01-08.txt | AC | 46 ms | 2560 KB |
01-09.txt | AC | 47 ms | 2560 KB |
01-10.txt | AC | 3 ms | 256 KB |
01-11.txt | AC | 11 ms | 640 KB |
01-12.txt | AC | 45 ms | 2432 KB |
01-13.txt | AC | 47 ms | 2560 KB |
01-14.txt | AC | 47 ms | 2560 KB |
01-15.txt | AC | 46 ms | 2560 KB |
01-16.txt | AC | 47 ms | 2560 KB |
01-17.txt | AC | 47 ms | 2560 KB |
01-18.txt | AC | 48 ms | 2560 KB |
01-19.txt | AC | 47 ms | 2560 KB |
02-01.txt | WA | 11 ms | 640 KB |
02-02.txt | WA | 44 ms | 2560 KB |
02-03.txt | WA | 45 ms | 2560 KB |
02-04.txt | WA | 45 ms | 2560 KB |
02-05.txt | WA | 3 ms | 256 KB |
02-06.txt | WA | 46 ms | 2560 KB |
02-07.txt | WA | 46 ms | 2560 KB |
02-08.txt | WA | 3 ms | 256 KB |
02-09.txt | WA | 3 ms | 256 KB |
02-10.txt | WA | 25 ms | 1408 KB |
02-11.txt | WA | 47 ms | 2560 KB |
02-12.txt | WA | 46 ms | 2560 KB |
02-13.txt | WA | 47 ms | 2560 KB |
02-14.txt | WA | 47 ms | 2560 KB |
02-15.txt | WA | 47 ms | 2560 KB |
02-16.txt | WA | 47 ms | 2560 KB |
sample-01.txt | AC | 3 ms | 256 KB |
sample-02.txt | WA | 3 ms | 256 KB |