Submission #2297019
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define INF_LL (int64)1e18 #define INF (int32)1e9 #define REP(i, n) for(int i = 0;i < (n);i++) #define FOR(i, a, b) for(int i = (a);i < (b);i++) #define all(x) x.begin(),x.end() #define fs first #define sc second using int32 = int_fast32_t; using uint32 = uint_fast32_t; using int64 = int_fast64_t; using uint64 = uint_fast64_t; using PII = pair<int32, int32>; using PLL = pair<int64, int64>; const double eps = 1e-10; template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;} template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;} const int64 mod = 1e9+7; using PIC = pair<int32, char>; int main(void){ int32 sum[212345] = {}; int32 N; cin >> N; vector<PII> com(N); REP(i, N){ cin >> com[i].fs >> com[i].sc; sum[com[i].fs]++; } REP(i, 212344){ sum[i+1] += sum[i]; } REP(i, N){ cout << sum[com[i].sc]-sum[com[i].fs] << endl; } }
Submission Info
Submission Time | |
---|---|
Task | B - How are you? |
User | maze1230 |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 984 Byte |
Status | AC |
Exec Time | 212 ms |
Memory | 4096 KB |
Judge Result
Set Name | Sample | Dataset1 | Dataset2 | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 30 / 30 | 70 / 70 | ||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
Sample | sample-01.txt, sample-02.txt |
Dataset1 | sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt |
Dataset2 | 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, sample-01.txt, sample-02.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | AC | 2 ms | 1920 KB |
01-02.txt | AC | 2 ms | 1920 KB |
01-03.txt | AC | 2 ms | 1920 KB |
01-04.txt | AC | 2 ms | 1920 KB |
01-05.txt | AC | 2 ms | 1920 KB |
01-06.txt | AC | 4 ms | 1920 KB |
01-07.txt | AC | 6 ms | 1920 KB |
01-08.txt | AC | 6 ms | 1920 KB |
01-09.txt | AC | 6 ms | 1920 KB |
01-10.txt | AC | 6 ms | 1920 KB |
02-01.txt | AC | 6 ms | 1920 KB |
02-02.txt | AC | 12 ms | 2048 KB |
02-03.txt | AC | 106 ms | 2944 KB |
02-04.txt | AC | 212 ms | 3968 KB |
02-05.txt | AC | 211 ms | 3968 KB |
02-06.txt | AC | 209 ms | 4096 KB |
02-07.txt | AC | 210 ms | 3712 KB |
sample-01.txt | AC | 2 ms | 1920 KB |
sample-02.txt | AC | 2 ms | 1920 KB |