답안 #951220

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
951220 2024-03-21T11:52:58 Z NourWael Fuel Station (NOI20_fuelstation) C++17
24 / 100
3000 ms 11840 KB
#include <bits/stdc++.h>
#define int long long
using namespace std; 
int const mxN = 3e5+5;

vector<pair<int,pair<int,int>>>a;
signed main() {
  
  ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);

  int n,d; cin>>n>>d;
  a.resize(n+1);
  for(int i=0; i<n; i++) cin>>a[i].first>>a[i].second.first>>a[i].second.second;
  a[n] = {d,{0,0}};
  sort(a.begin(),a.end());

  for(int i=1; i<=d; i++) {
   int mid = i, now = i;
   bool f = 1;
   if(mid<a[0].first) f = 0;
   else now -= a[0].first;
   for(int j=0; j<n; j++) {
      if(mid<=a[j].second.second) now += a[j].second.first;
      if(now<abs(a[j+1].first-a[j].first)) { f = 0; break; }
      now -= abs(a[j+1].first-a[j].first);
   }
   
   if(f) { cout<<mid<<'\n'; return 0; }

  }

   return 0;
}


# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 344 KB Output is correct
2 Correct 4 ms 348 KB Output is correct
3 Correct 1576 ms 428 KB Output is correct
4 Correct 4 ms 344 KB Output is correct
5 Correct 3 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 5 ms 348 KB Output is correct
8 Correct 1375 ms 428 KB Output is correct
9 Correct 1251 ms 424 KB Output is correct
10 Correct 2603 ms 444 KB Output is correct
11 Correct 2 ms 348 KB Output is correct
12 Correct 3 ms 348 KB Output is correct
13 Correct 617 ms 428 KB Output is correct
14 Correct 5 ms 348 KB Output is correct
15 Correct 4 ms 452 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3042 ms 7260 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 3 ms 604 KB Output is correct
3 Correct 2 ms 604 KB Output is correct
4 Correct 3 ms 604 KB Output is correct
5 Correct 3 ms 604 KB Output is correct
6 Correct 2 ms 604 KB Output is correct
7 Correct 3 ms 604 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 456 KB Output is correct
14 Correct 184 ms 604 KB Output is correct
15 Correct 184 ms 612 KB Output is correct
16 Correct 161 ms 604 KB Output is correct
17 Correct 121 ms 600 KB Output is correct
18 Correct 108 ms 604 KB Output is correct
19 Correct 5 ms 856 KB Output is correct
20 Correct 4 ms 860 KB Output is correct
21 Correct 3 ms 860 KB Output is correct
22 Correct 3 ms 812 KB Output is correct
23 Correct 4 ms 604 KB Output is correct
24 Correct 3 ms 604 KB Output is correct
25 Correct 3 ms 720 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 3 ms 604 KB Output is correct
3 Correct 2 ms 604 KB Output is correct
4 Correct 3 ms 604 KB Output is correct
5 Correct 3 ms 604 KB Output is correct
6 Correct 2 ms 604 KB Output is correct
7 Correct 3 ms 604 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 456 KB Output is correct
14 Correct 184 ms 604 KB Output is correct
15 Correct 184 ms 612 KB Output is correct
16 Correct 161 ms 604 KB Output is correct
17 Correct 121 ms 600 KB Output is correct
18 Correct 108 ms 604 KB Output is correct
19 Correct 5 ms 856 KB Output is correct
20 Correct 4 ms 860 KB Output is correct
21 Correct 3 ms 860 KB Output is correct
22 Correct 3 ms 812 KB Output is correct
23 Correct 4 ms 604 KB Output is correct
24 Correct 3 ms 604 KB Output is correct
25 Correct 3 ms 720 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 93 ms 11716 KB Output is correct
28 Correct 76 ms 11344 KB Output is correct
29 Correct 77 ms 11200 KB Output is correct
30 Correct 79 ms 11076 KB Output is correct
31 Correct 76 ms 11840 KB Output is correct
32 Correct 73 ms 11328 KB Output is correct
33 Correct 1 ms 344 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 1 ms 348 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Correct 1 ms 460 KB Output is correct
39 Execution timed out 3048 ms 11700 KB Time limit exceeded
40 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 344 KB Output is correct
2 Correct 4 ms 348 KB Output is correct
3 Correct 1576 ms 428 KB Output is correct
4 Correct 4 ms 344 KB Output is correct
5 Correct 3 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 5 ms 348 KB Output is correct
8 Correct 1375 ms 428 KB Output is correct
9 Correct 1251 ms 424 KB Output is correct
10 Correct 2603 ms 444 KB Output is correct
11 Correct 2 ms 348 KB Output is correct
12 Correct 3 ms 348 KB Output is correct
13 Correct 617 ms 428 KB Output is correct
14 Correct 5 ms 348 KB Output is correct
15 Correct 4 ms 452 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 33 ms 348 KB Output is correct
18 Execution timed out 3072 ms 348 KB Time limit exceeded
19 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 344 KB Output is correct
2 Correct 4 ms 348 KB Output is correct
3 Correct 1576 ms 428 KB Output is correct
4 Correct 4 ms 344 KB Output is correct
5 Correct 3 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 5 ms 348 KB Output is correct
8 Correct 1375 ms 428 KB Output is correct
9 Correct 1251 ms 424 KB Output is correct
10 Correct 2603 ms 444 KB Output is correct
11 Correct 2 ms 348 KB Output is correct
12 Correct 3 ms 348 KB Output is correct
13 Correct 617 ms 428 KB Output is correct
14 Correct 5 ms 348 KB Output is correct
15 Correct 4 ms 452 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 3 ms 604 KB Output is correct
18 Correct 2 ms 604 KB Output is correct
19 Correct 3 ms 604 KB Output is correct
20 Correct 3 ms 604 KB Output is correct
21 Correct 2 ms 604 KB Output is correct
22 Correct 3 ms 604 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 1 ms 456 KB Output is correct
29 Correct 184 ms 604 KB Output is correct
30 Correct 184 ms 612 KB Output is correct
31 Correct 161 ms 604 KB Output is correct
32 Correct 121 ms 600 KB Output is correct
33 Correct 108 ms 604 KB Output is correct
34 Correct 5 ms 856 KB Output is correct
35 Correct 4 ms 860 KB Output is correct
36 Correct 3 ms 860 KB Output is correct
37 Correct 3 ms 812 KB Output is correct
38 Correct 4 ms 604 KB Output is correct
39 Correct 3 ms 604 KB Output is correct
40 Correct 3 ms 720 KB Output is correct
41 Correct 8 ms 600 KB Output is correct
42 Correct 828 ms 860 KB Output is correct
43 Correct 261 ms 872 KB Output is correct
44 Correct 776 ms 856 KB Output is correct
45 Correct 961 ms 816 KB Output is correct
46 Correct 1185 ms 872 KB Output is correct
47 Correct 289 ms 860 KB Output is correct
48 Correct 1 ms 344 KB Output is correct
49 Correct 1 ms 348 KB Output is correct
50 Correct 1 ms 348 KB Output is correct
51 Correct 1 ms 348 KB Output is correct
52 Correct 2240 ms 432 KB Output is correct
53 Correct 1 ms 344 KB Output is correct
54 Execution timed out 3044 ms 860 KB Time limit exceeded
55 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 344 KB Output is correct
2 Correct 4 ms 348 KB Output is correct
3 Correct 1576 ms 428 KB Output is correct
4 Correct 4 ms 344 KB Output is correct
5 Correct 3 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 5 ms 348 KB Output is correct
8 Correct 1375 ms 428 KB Output is correct
9 Correct 1251 ms 424 KB Output is correct
10 Correct 2603 ms 444 KB Output is correct
11 Correct 2 ms 348 KB Output is correct
12 Correct 3 ms 348 KB Output is correct
13 Correct 617 ms 428 KB Output is correct
14 Correct 5 ms 348 KB Output is correct
15 Correct 4 ms 452 KB Output is correct
16 Execution timed out 3042 ms 7260 KB Time limit exceeded
17 Halted 0 ms 0 KB -