#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define PB push_back
#define MP make_pair
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) (int((x.size())))
#define fi first
#define se second
typedef long double ld;
typedef long long ll;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef vector<ll> VL;
typedef vector<PLL> VPL;
typedef vector<PII> VPI;
typedef tree <int, null_type, less<int> ,rb_tree_tag ,tree_order_statistics_node_update > ordered_set;
#define REP(i,a,n) for (int i = a; i < n; i++)
#define PER(i,a,n) for (int i = n-1; i >= a; i--)
#define dbb(x) cout << #x << " = " << x << "\t";
#define db(x) { dbb(x); cout << endl; }
#define db2(x,y) { dbb(x); dbb(y); cout << endl; }
#define db3(x,y,z) { dbb(x); dbb(y); dbb(z); cout << endl; }
template <typename t1, typename t2> inline bool upmax(t1 &a, t2 b) { if (a<(t1)b) { a = (t1)b; return true; } else return false; }
template <typename t1, typename t2> inline bool upmin(t1 &a, t2 b) { if (a>(t1)b) { a = (t1)b; return true; } else return false; }
template <typename T> inline bool pal(T &x){ int n = SZ(x); REP(i, 0, n / 2) { if (x[i] != x[n - i - 1]) return 0; } return 1; }
template <typename T> inline T gcd(T a, T b) { return b ? gcd(b, a%b) : a; }
template <typename T> inline T lcm(T a, T b) { return a*(b / gcd(a, b)); }
template <typename T> inline T sqr(T a) { return a*a; }
int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
int dy[] = { 0, 1, 0, -1, 1, -1, 1, -1 };
const int INF = 1000000404;
const ll LINF = 4000000000000000404ll;
const ll MOD = 1000000007ll;
const ld PI = acos(-1.0);
const ld EPS = 1e-9;
ll powmod(ll a, ll b) {
ll res = 1; a %= MOD; assert(b >= 0);
for (; b; b >>= 1) { if (b & 1) res = res*a%MOD; a = a*a%MOD; }return res;
}
int SQ = 404;
int timer = 0;
#define N 555
int a[N];
int b[N];
void solve() {
int n;
cin >> n;
ll s = 0;
REP (i, 1, n + 1) {
cin >> a[i] >> b[i];
s+= (b[i]-a[i]+1);
s%=MOD;
}
cout << s <<endl;
}
int main()
{
// freopen("INPUT.in","r",stdin);
// freopen("OUTPUT.out","w",stdout);
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int t = 1;
//cin >> t;
while (t--) {
solve();
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |