Skip to content

Commit 5a2b7cd

Browse files
committed
atcoder/abc181B
1 parent 1414fba commit 5a2b7cd

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

atcoder/abc181/B/main.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <bits/stdc++.h>
2+
3+
using namespace std;
4+
using ll = int64_t;
5+
using ff = long double;
6+
7+
int main() {
8+
ios_base::sync_with_stdio(false);
9+
cin.tie(0); cout.tie(0);
10+
11+
int N;
12+
13+
cin >> N;
14+
15+
ll sum = 0;
16+
for (int i = 0; i < N; ++i) {
17+
int A, B;
18+
cin >> A >> B;
19+
sum += ll(A + B) * (B - A + 1) / 2;
20+
}
21+
cout << sum << endl;
22+
23+
return 0;
24+
}

0 commit comments

Comments
 (0)