Submission #3042630
Source Code Expand
import bisect n,m,Q = map(int,input().split()) table = [] for i in range(m): l,r = map(int,input().split()) table.append([l,r,0]) question = [] for i in range(Q): p,q = map(int,input().split()) question.append([p,q]) table.append([p,q,1]) table.sort(key = lambda x: (x[1],x[2])) cum = [0 for i in range(n+1)] answer = dict() for i in range(m+Q): if table[i][2] == 0: cum[table[i][0]] += 1 else: ans = 0 for k in range(table[i][0],table[i][1]+1): ans += cum[k] num = table[i][0]*10 + table[i][1] answer[num] = ans for i in range(Q): ind = question[i][0]*10 + question[i][1] print(answer[ind])
Submission Info
Submission Time | |
---|---|
Task | D - AtCoder Express 2 |
User | asaka |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 716 Byte |
Status | TLE |
Exec Time | 3160 ms |
Memory | 77640 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 | 17 ms | 3064 KB |
in02.txt | AC | 17 ms | 3064 KB |
in03.txt | AC | 17 ms | 3064 KB |
in04.txt | AC | 17 ms | 3064 KB |
in05.txt | TLE | 3160 ms | 77328 KB |
in06.txt | TLE | 3160 ms | 77492 KB |
in07.txt | TLE | 3159 ms | 77368 KB |
in08.txt | TLE | 3160 ms | 77640 KB |
in09.txt | TLE | 3159 ms | 76576 KB |
in10.txt | TLE | 3160 ms | 76200 KB |
sample_01.txt | AC | 17 ms | 3064 KB |
sample_02.txt | AC | 17 ms | 3064 KB |
sample_03.txt | AC | 17 ms | 3064 KB |