답안 #237808

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
237808 2020-06-08T21:16:47 Z Haunted_Cpp Lasers (NOI19_lasers) C++17
100 / 100
946 ms 40952 KB
#include <bits/stdc++.h>
using namespace std;

int main () {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int l, r, res = 0;
  cin >> l >> r;
  map<int, int> eventos;
  for (int T = 0; T < r; T++) {
    int qts;
    cin >> qts;
    int s = 0;
    vector<int> arr (qts);
    for (int i = 0; i < qts; i++) {
      cin >> arr[i];
      s += arr[i];
    }
    int cur = 0;
    int mn = 0;
    int st, et;
    for (int i = 0; i < qts; i++) {
      st = max (mn, cur);
      et = l - s - 1;
      //cout << st << ' ' << et << '\n';
      eventos[st]++;
      eventos[et + 1]--;
      mn = max (mn, l - s);
      cur += arr[i];
      s -= arr[i];
    } 
    st = max (mn, cur);
    et = l - s - 1;
    //cout << st << ' ' << et << '\n';
    eventos[st]++;
    eventos[et + 1]--;
  }
  eventos[l - 1] += 0;
  int cur = 0;
  int where_am_i = 0;
  for (auto to : eventos) {
    int where = to.first;
    int d = to.second;
    if (cur < r) {
      res += (where - where_am_i);
    }
    cur += d;
    where_am_i = where;
  }
  cout << res << '\n';
  return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Correct 4 ms 384 KB Output is correct
8 Correct 5 ms 256 KB Output is correct
9 Correct 5 ms 384 KB Output is correct
10 Correct 5 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Correct 4 ms 384 KB Output is correct
8 Correct 5 ms 256 KB Output is correct
9 Correct 5 ms 384 KB Output is correct
10 Correct 5 ms 384 KB Output is correct
11 Correct 5 ms 384 KB Output is correct
12 Correct 131 ms 4728 KB Output is correct
13 Correct 5 ms 256 KB Output is correct
14 Correct 4 ms 384 KB Output is correct
15 Correct 5 ms 384 KB Output is correct
16 Correct 6 ms 512 KB Output is correct
17 Correct 903 ms 38008 KB Output is correct
18 Correct 5 ms 384 KB Output is correct
19 Correct 5 ms 384 KB Output is correct
20 Correct 5 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 146 ms 20860 KB Output is correct
2 Correct 33 ms 4740 KB Output is correct
3 Correct 37 ms 5548 KB Output is correct
4 Correct 143 ms 22004 KB Output is correct
5 Correct 57 ms 10744 KB Output is correct
6 Correct 176 ms 20540 KB Output is correct
7 Correct 7 ms 768 KB Output is correct
8 Correct 190 ms 23292 KB Output is correct
9 Correct 82 ms 13800 KB Output is correct
10 Correct 159 ms 23980 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 5 ms 384 KB Output is correct
9 Correct 5 ms 384 KB Output is correct
10 Correct 5 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 146 ms 20860 KB Output is correct
2 Correct 33 ms 4740 KB Output is correct
3 Correct 37 ms 5548 KB Output is correct
4 Correct 143 ms 22004 KB Output is correct
5 Correct 57 ms 10744 KB Output is correct
6 Correct 176 ms 20540 KB Output is correct
7 Correct 7 ms 768 KB Output is correct
8 Correct 190 ms 23292 KB Output is correct
9 Correct 82 ms 13800 KB Output is correct
10 Correct 159 ms 23980 KB Output is correct
11 Correct 5 ms 384 KB Output is correct
12 Correct 5 ms 384 KB Output is correct
13 Correct 5 ms 384 KB Output is correct
14 Correct 5 ms 384 KB Output is correct
15 Correct 5 ms 384 KB Output is correct
16 Correct 5 ms 384 KB Output is correct
17 Correct 5 ms 384 KB Output is correct
18 Correct 5 ms 384 KB Output is correct
19 Correct 5 ms 384 KB Output is correct
20 Correct 5 ms 384 KB Output is correct
21 Correct 819 ms 26936 KB Output is correct
22 Correct 97 ms 8952 KB Output is correct
23 Correct 41 ms 7032 KB Output is correct
24 Correct 213 ms 23624 KB Output is correct
25 Correct 834 ms 26744 KB Output is correct
26 Correct 246 ms 16632 KB Output is correct
27 Correct 76 ms 7672 KB Output is correct
28 Correct 815 ms 26880 KB Output is correct
29 Correct 812 ms 27152 KB Output is correct
30 Correct 143 ms 19024 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Correct 4 ms 384 KB Output is correct
8 Correct 5 ms 256 KB Output is correct
9 Correct 5 ms 384 KB Output is correct
10 Correct 5 ms 384 KB Output is correct
11 Correct 5 ms 384 KB Output is correct
12 Correct 131 ms 4728 KB Output is correct
13 Correct 5 ms 256 KB Output is correct
14 Correct 4 ms 384 KB Output is correct
15 Correct 5 ms 384 KB Output is correct
16 Correct 6 ms 512 KB Output is correct
17 Correct 903 ms 38008 KB Output is correct
18 Correct 5 ms 384 KB Output is correct
19 Correct 5 ms 384 KB Output is correct
20 Correct 5 ms 384 KB Output is correct
21 Correct 146 ms 20860 KB Output is correct
22 Correct 33 ms 4740 KB Output is correct
23 Correct 37 ms 5548 KB Output is correct
24 Correct 143 ms 22004 KB Output is correct
25 Correct 57 ms 10744 KB Output is correct
26 Correct 176 ms 20540 KB Output is correct
27 Correct 7 ms 768 KB Output is correct
28 Correct 190 ms 23292 KB Output is correct
29 Correct 82 ms 13800 KB Output is correct
30 Correct 159 ms 23980 KB Output is correct
31 Correct 5 ms 384 KB Output is correct
32 Correct 5 ms 384 KB Output is correct
33 Correct 5 ms 384 KB Output is correct
34 Correct 5 ms 384 KB Output is correct
35 Correct 5 ms 384 KB Output is correct
36 Correct 5 ms 384 KB Output is correct
37 Correct 5 ms 384 KB Output is correct
38 Correct 5 ms 384 KB Output is correct
39 Correct 5 ms 384 KB Output is correct
40 Correct 5 ms 384 KB Output is correct
41 Correct 819 ms 26936 KB Output is correct
42 Correct 97 ms 8952 KB Output is correct
43 Correct 41 ms 7032 KB Output is correct
44 Correct 213 ms 23624 KB Output is correct
45 Correct 834 ms 26744 KB Output is correct
46 Correct 246 ms 16632 KB Output is correct
47 Correct 76 ms 7672 KB Output is correct
48 Correct 815 ms 26880 KB Output is correct
49 Correct 812 ms 27152 KB Output is correct
50 Correct 143 ms 19024 KB Output is correct
51 Correct 62 ms 9848 KB Output is correct
52 Correct 944 ms 40440 KB Output is correct
53 Correct 946 ms 40312 KB Output is correct
54 Correct 176 ms 14328 KB Output is correct
55 Correct 569 ms 34168 KB Output is correct
56 Correct 184 ms 24612 KB Output is correct
57 Correct 296 ms 23032 KB Output is correct
58 Correct 938 ms 40952 KB Output is correct
59 Correct 206 ms 17144 KB Output is correct
60 Correct 310 ms 23212 KB Output is correct