Submission #951208

# Submission time Handle Problem Language Result Execution time Memory
951208 2024-03-21T11:27:54 Z NourWael Fuel Station (NOI20_fuelstation) C++17
7 / 100
3000 ms 15844 KB
#include <bits/extc++.h>
#define int long long
using namespace std; 
int const mxN = 3e5+5;

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

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

  for(int i=1; i<=d; i++) {
   int mid = i;

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

  }

   return 0;
}


# Verdict Execution time Memory Grader output
1 Correct 5 ms 348 KB Output is correct
2 Correct 3 ms 348 KB Output is correct
3 Correct 1845 ms 440 KB Output is correct
4 Correct 4 ms 348 KB Output is correct
5 Correct 3 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 4 ms 348 KB Output is correct
8 Correct 1630 ms 440 KB Output is correct
9 Correct 1604 ms 436 KB Output is correct
10 Correct 2421 ms 436 KB Output is correct
11 Correct 5 ms 784 KB Output is correct
12 Correct 3 ms 456 KB Output is correct
13 Correct 556 ms 436 KB Output is correct
14 Correct 4 ms 464 KB Output is correct
15 Correct 3 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 3041 ms 15844 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 3 ms 2652 KB Output is correct
3 Correct 3 ms 2652 KB Output is correct
4 Correct 3 ms 2776 KB Output is correct
5 Correct 3 ms 2652 KB Output is correct
6 Correct 3 ms 2908 KB Output is correct
7 Correct 3 ms 2652 KB Output is correct
8 Incorrect 0 ms 348 KB Output isn't correct
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 3 ms 2652 KB Output is correct
3 Correct 3 ms 2652 KB Output is correct
4 Correct 3 ms 2776 KB Output is correct
5 Correct 3 ms 2652 KB Output is correct
6 Correct 3 ms 2908 KB Output is correct
7 Correct 3 ms 2652 KB Output is correct
8 Incorrect 0 ms 348 KB Output isn't correct
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 348 KB Output is correct
2 Correct 3 ms 348 KB Output is correct
3 Correct 1845 ms 440 KB Output is correct
4 Correct 4 ms 348 KB Output is correct
5 Correct 3 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 4 ms 348 KB Output is correct
8 Correct 1630 ms 440 KB Output is correct
9 Correct 1604 ms 436 KB Output is correct
10 Correct 2421 ms 436 KB Output is correct
11 Correct 5 ms 784 KB Output is correct
12 Correct 3 ms 456 KB Output is correct
13 Correct 556 ms 436 KB Output is correct
14 Correct 4 ms 464 KB Output is correct
15 Correct 3 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 37 ms 348 KB Output is correct
18 Incorrect 849 ms 436 KB Output isn't correct
19 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 348 KB Output is correct
2 Correct 3 ms 348 KB Output is correct
3 Correct 1845 ms 440 KB Output is correct
4 Correct 4 ms 348 KB Output is correct
5 Correct 3 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 4 ms 348 KB Output is correct
8 Correct 1630 ms 440 KB Output is correct
9 Correct 1604 ms 436 KB Output is correct
10 Correct 2421 ms 436 KB Output is correct
11 Correct 5 ms 784 KB Output is correct
12 Correct 3 ms 456 KB Output is correct
13 Correct 556 ms 436 KB Output is correct
14 Correct 4 ms 464 KB Output is correct
15 Correct 3 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 3 ms 2652 KB Output is correct
18 Correct 3 ms 2652 KB Output is correct
19 Correct 3 ms 2776 KB Output is correct
20 Correct 3 ms 2652 KB Output is correct
21 Correct 3 ms 2908 KB Output is correct
22 Correct 3 ms 2652 KB Output is correct
23 Incorrect 0 ms 348 KB Output isn't correct
24 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 348 KB Output is correct
2 Correct 3 ms 348 KB Output is correct
3 Correct 1845 ms 440 KB Output is correct
4 Correct 4 ms 348 KB Output is correct
5 Correct 3 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 4 ms 348 KB Output is correct
8 Correct 1630 ms 440 KB Output is correct
9 Correct 1604 ms 436 KB Output is correct
10 Correct 2421 ms 436 KB Output is correct
11 Correct 5 ms 784 KB Output is correct
12 Correct 3 ms 456 KB Output is correct
13 Correct 556 ms 436 KB Output is correct
14 Correct 4 ms 464 KB Output is correct
15 Correct 3 ms 348 KB Output is correct
16 Execution timed out 3041 ms 15844 KB Time limit exceeded
17 Halted 0 ms 0 KB -