File tree Expand file tree Collapse file tree 4 files changed +49
-0
lines changed
Expand file tree Collapse file tree 4 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,7 @@ There are solutions for the following
3343341 . [ Synchronizing Lists] ( synchronizinglists.cc ) ([ problem site] ( https://open.kattis.com/problems/synchronizinglists ) )
3353351 . [ T9 Spelling] ( t9spelling.cc ) ([ problem site] ( https://open.kattis.com/problems/t9spelling ) )
3363361 . [ Tarifa] ( tarifa.cc ) ([ problem site] ( https://open.kattis.com/problems/tarifa ) )
337+ 1 . [ Happy Telephones] ( telephones.cc ) ([ problem site] ( https://open.kattis.com/problems/telephones ) )
3373381 . [ Temperature Confusion] ( temperatureconfusion.py ) ([ problem site] ( https://open.kattis.com/problems/temperatureconfusion ) )
3383391 . [ Test] ( test2.cc ) ([ problem site] ( https://open.kattis.com/problems/test2 ) )
3393401 . [ The Last Problem] ( thelastproblem.py ) ([ problem site] ( https://open.kattis.com/problems/thelastproblem ) )
Original file line number Diff line number Diff line change 1+ 3
2+ 2
3+ 1
4+ 0
Original file line number Diff line number Diff line change 1+ 3 2
2+ 3 4 2 5
3+ 1 2 0 10
4+ 6 5 5 8
5+ 0 6
6+ 8 2
7+ 1 2
8+ 8 9 0 10
9+ 9 1
10+ 10 1
11+ 0 0
Original file line number Diff line number Diff line change 1+ // https://open.kattis.com/problems/telephones
2+ #include < bits/stdc++.h>
3+
4+ using namespace std ;
5+
6+ const int N = 1e4 ;
7+ pair<int , int > calls[N];
8+
9+ int main () {
10+ cin.tie (0 ), ios::sync_with_stdio (0 );
11+ while (1 ) {
12+ int n, m;
13+ cin >> n >> m;
14+ if (!n) break ;
15+ for (int i = 0 ; i < n; i++) {
16+ int a, b, c, d;
17+ cin >> a >> b >> c >> d;
18+ calls[i] = {c, c + d};
19+ }
20+ while (m--) {
21+ int start, end;
22+ cin >> start >> end;
23+ end += start;
24+ int c = 0 ;
25+ for (int i = 0 ; i < n; i++) {
26+ int s, e;
27+ tie (s, e) = calls[i];
28+ c += s < end && e > start;
29+ }
30+ cout << c << ' \n ' ;
31+ }
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments