Submission #916221

# Submission time Handle Problem Language Result Execution time Memory
916221 2024-01-25T13:47:18 Z kachu Truck Driver (IOI23_deliveries) C++17
0 / 100
5500 ms 4948 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include "deliveries.h"

using namespace std;
using namespace __gnu_pbds;

int a, b, d;

void init(int N, std::vector<int> U, std::vector<int> V, std::vector<int> T, std::vector<int> W) {
	a = W[0];
	b = W[1];
	d = T[0];
}

long long max_time(int S, int X){
	if (S == 0) a = X;
	else b = X;
	
	int A = a, B = b, ans = 0;
	bool flag = 0;
	
	while (A > 0 || B > 0){
		if (flag == 0){
			if (B == 0){
				break;
			}
			else{
				ans += d;
				B--;
			}
			flag = !flag;
		}
		else{
			if (A == 0){
				ans += d;
				break;
			}
			else{
				ans += d;
				A--;
			}
			flag = !flag;
		}
	}
	
	return ans;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 5546 ms 4948 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB 3rd lines differ - on the 1st token, expected: '1627540', found: '272'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5546 ms 4948 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5546 ms 4948 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5546 ms 4948 KB Time limit exceeded
2 Halted 0 ms 0 KB -