Submission #9819031
Source Code Expand
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for(int i=0; i<n; i++) #define rrep(i, n) for(int i=n-1; i>=0; i--) #define FOR(i, a, b) for(int i=a; i<b; i++) #define ALL(v) v.begin(),v.end() typedef long long ll; typedef pair<int, int> pii; typedef pair<int, ll> pil; typedef pair<ll, int> pli; typedef pair<ll, ll> pll; const int INF = 1e9; const ll LLINF = 1e18; const ll MOD = 1e9+7; const double EPS = 1e-10; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } int a[505][505], s[505][505]; int main() { int N, M, Q; cin >> N >> M >> Q; rep(i, M) { int l, r; cin >> l >> r; a[l][r] += 1; } rep(i, Q) { int p, q; cin >> p >> q; int sum = 0; for (int j = p; j <= q; j++) { for (int k = p; k <= q; k++) { sum += a[j][k]; } } cout << sum << endl; } }
Submission Info
Submission Time | |
---|---|
Task | D - AtCoder Express 2 |
User | bokeh |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1066 Byte |
Status | TLE |
Exec Time | 3159 ms |
Memory | 1792 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | in01.txt, in02.txt, in03.txt, in04.txt, in05.txt, in06.txt, in07.txt, in08.txt, in09.txt, in10.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in01.txt | AC | 1 ms | 256 KB |
in02.txt | AC | 1 ms | 256 KB |
in03.txt | AC | 1 ms | 256 KB |
in04.txt | AC | 1 ms | 256 KB |
in05.txt | TLE | 3155 ms | 1792 KB |
in06.txt | TLE | 3159 ms | 1664 KB |
in07.txt | TLE | 3155 ms | 1664 KB |
in08.txt | TLE | 3155 ms | 1664 KB |
in09.txt | TLE | 3155 ms | 384 KB |
in10.txt | TLE | 3155 ms | 1408 KB |
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
sample_03.txt | AC | 1 ms | 256 KB |