Submission #3245327
Source Code Expand
#include<iostream> #include<algorithm> #include<string> #include<functional> #include<utility> #include<stack> #include<queue> #include<cmath> #include<list> #include<cstdint> #include<vector> #include<map> #include<deque> #define rep(i,rept) for(ll i = 0; i<(ll)rept;++i) typedef long long ll; using namespace std; int main() { //22日目 int n = 0, F = 0; vector<int> a; int sum = 0; cin >> n; rep(i, n) { cin >> F; a.push_back(F); sum += F; } int umaru = 0, d = 0; d = 99999999999; rep(i, n-1) { umaru += a[i]; d = min(d,abs(sum-2*umaru)); } cout << d << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Splitting Pile |
User | hinamel |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 642 Byte |
Status | WA |
Exec Time | 62 ms |
Memory | 1400 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:32:4: warning: overflow in implicit constant conversion [-Woverflow] d = 99999999999; ^
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_example_01.txt, 00_example_02.txt |
All | 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_example_01.txt | AC | 9 ms | 764 KB |
00_example_02.txt | AC | 1 ms | 256 KB |
01.txt | WA | 31 ms | 892 KB |
02.txt | WA | 12 ms | 640 KB |
03.txt | AC | 10 ms | 512 KB |
04.txt | WA | 40 ms | 892 KB |
05.txt | WA | 10 ms | 512 KB |
06.txt | WA | 62 ms | 1400 KB |
07.txt | WA | 62 ms | 1400 KB |
08.txt | WA | 62 ms | 1400 KB |
09.txt | WA | 62 ms | 1400 KB |
10.txt | WA | 62 ms | 1400 KB |
11.txt | AC | 1 ms | 256 KB |
12.txt | AC | 2 ms | 256 KB |
13.txt | AC | 47 ms | 1400 KB |
14.txt | WA | 1 ms | 256 KB |