Submission #2819337
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define fcout(d) cout << fixed << setprecision(d)
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define rep1(i,n) for(int (i) = 1; (i) <= (n); ++(i))
#define repU(i,bottom,ceiling) for(auto (i) = (bottom); (i) <= (ceiling); ++(i))
#define repD(i,ceiling,bottom) for(auto (i) = (ceiling); (i) >= (bottom); --(i))
#define repV(i,v) for(auto (i) = begin(v); (i) < end(v); ++(i))
#define all(v) begin(v),end(v)
#define clr(v) fill(all(v),0)
#define l_bnd lower_bound
#define u_bnd upper_bound
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define mkp make_pair
#define mkt make_tuple
#define fir first
#define sec second
#define q_ceil(n,d) ((n - 1)/(d) + 1)
#define parity(a,b) ((a)^(b) & 1LL ^ 1LL)
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
const pair<int,int> DIR[] = { {1,0},{0,1},{-1,0},{0,-1},{1,1},{-1,1},{-1,-1},{1,-1} };
const int INF_32 = -1 + (1 << 30);
const ll INF_64 = -1 + (1LL << 62);
const int MOD = (int)1e9 + 7;
ull next_subset(ull subset){
ull tem = subset + (subset & -subset);
ull btm = (~tem & subset) / (subset & -subset) >> 1;
return btm | tem;
}
int m = INF_32,n,a,b;
ll s = 0;
void solve(){
return;
}
void input(){
cin>>n;
rep(i,n){
cin>>a>>b;
s += a;
if(b < a) m = min(m,b);
}
if(m == INF_32){
cout<<0<<endl;
}else{
cout<<s-m<<endl;
}
return;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
input();
solve();
return 0;
}
Submission Info
Submission Time |
|
Task |
E - Tozan and Gezan |
User |
jell |
Language |
C++14 (GCC 5.4.1) |
Score |
700 |
Code Size |
1607 Byte |
Status |
AC |
Exec Time |
5 ms |
Memory |
256 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
700 / 700 |
Status |
|
|
Set Name |
Test Cases |
Sample |
s1.txt, s2.txt, s3.txt |
All |
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, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, 28.txt, 29.txt, 30.txt, 31.txt, 32.txt, s1.txt, s2.txt, s3.txt |
Case Name |
Status |
Exec Time |
Memory |
01.txt |
AC |
5 ms |
256 KB |
02.txt |
AC |
5 ms |
256 KB |
03.txt |
AC |
5 ms |
256 KB |
04.txt |
AC |
5 ms |
256 KB |
05.txt |
AC |
5 ms |
256 KB |
06.txt |
AC |
5 ms |
256 KB |
07.txt |
AC |
5 ms |
256 KB |
08.txt |
AC |
5 ms |
256 KB |
09.txt |
AC |
5 ms |
256 KB |
10.txt |
AC |
5 ms |
256 KB |
11.txt |
AC |
5 ms |
256 KB |
12.txt |
AC |
5 ms |
256 KB |
13.txt |
AC |
5 ms |
256 KB |
14.txt |
AC |
5 ms |
256 KB |
15.txt |
AC |
5 ms |
256 KB |
16.txt |
AC |
5 ms |
256 KB |
17.txt |
AC |
5 ms |
256 KB |
18.txt |
AC |
5 ms |
256 KB |
19.txt |
AC |
5 ms |
256 KB |
20.txt |
AC |
5 ms |
256 KB |
21.txt |
AC |
5 ms |
256 KB |
22.txt |
AC |
5 ms |
256 KB |
23.txt |
AC |
5 ms |
256 KB |
24.txt |
AC |
5 ms |
256 KB |
25.txt |
AC |
5 ms |
256 KB |
26.txt |
AC |
5 ms |
256 KB |
27.txt |
AC |
5 ms |
256 KB |
28.txt |
AC |
5 ms |
256 KB |
29.txt |
AC |
5 ms |
256 KB |
30.txt |
AC |
5 ms |
256 KB |
31.txt |
AC |
1 ms |
256 KB |
32.txt |
AC |
1 ms |
256 KB |
s1.txt |
AC |
1 ms |
256 KB |
s2.txt |
AC |
1 ms |
256 KB |
s3.txt |
AC |
1 ms |
256 KB |