FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Problem-Solving/AtCoder/Splitting_Pile.cpp at master · youssefAli11997/Problem-Solving · GitHub
youssefAli11997
/
Problem-Solving
Public
Notifications
You must be signed in to change notification settings
Fork
6
Star
3
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Problem-Solving
/
AtCoder
/
Splitting_Pile.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
20 lines (19 loc) · 384 Bytes
Breadcrumbs
Problem-Solving
/
AtCoder
/
Splitting_Pile.cpp
Copy path
File metadata and controls
20 lines (19 loc) · 384 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//
problem link : http://abc067.contest.atcoder.jp/tasks/arc078_a
#
include
<
bits/stdc++.h
>
using
namespace
std
;
long
long
n,sumA,sumB,mn;
int
main
(){
cin>>n;
int
arr[n];
for
(
int
i=
0
; i<n; i++){
cin>>arr[i];
sumA += arr[i];
}
mn =
1e15
;
for
(
int
i=n-
1
; i>
0
; i--){
sumA -= arr[i];
sumB += arr[i];
mn =
min
(mn,
abs
(sumA - sumB));
}
cout<<mn<<endl;
}
Back
|
FazBrowse Home
|
New Git URL