답안 #940139

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
940139 2024-03-07T05:52:59 Z vjudge1 꿈 (IOI13_dreaming) C++17
0 / 100
20 ms 2284 KB
#include<bits/stdc++.h>	
#include "dreaming.h"
using namespace std;

#define all(a) a.begin(), a.end()                                                   
#define rall(a) a.rbegin(), a.rend()                 
#define sz(a) (int)a.size()
#define s second
#define f first
 
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
     
vector<pii> rid = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
vector<pii> dir = {{-1, -1}, {-1, 1}, {1, -1}, {1, 1}};

int travelTime(int n, int m, int l, int a[], int b[], int c[]) {
	vector<int> s = {0, 0, 0};
	for (int i = 0; i < m; i++) s.push_back(c[i]);
	sort(rall(s));
	return max(s[0] + s[1] + l, s[1] + s[2] + 2 * l);	     	
}

#ifdef M
main() {
	//freopen("rsq.in", "r", stdin);                                                                                     
	//freopen("rsq.out", "w", stdout);                                                                                     
	ios_base::sync_with_stdio(0);	                                                                                       
	cin.tie(0);
	int n, m, l;
	cin >> n >> m >> l;
	int a[m], b[m], c[m];
	for (int i = 0; i < m; i++) cin >> a[i] >> b[i] >> c[i];
	cout << travelTime(n, m, l, a, b, c);
}
#endif
# 결과 실행 시간 메모리 Grader output
1 Incorrect 20 ms 2284 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 20 ms 2284 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 1116 KB Output is correct
2 Correct 7 ms 1008 KB Output is correct
3 Correct 8 ms 1116 KB Output is correct
4 Correct 7 ms 1116 KB Output is correct
5 Correct 11 ms 1116 KB Output is correct
6 Correct 7 ms 1116 KB Output is correct
7 Correct 7 ms 1116 KB Output is correct
8 Correct 7 ms 1052 KB Output is correct
9 Correct 7 ms 1116 KB Output is correct
10 Correct 7 ms 1308 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Incorrect 0 ms 348 KB Output isn't correct
21 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 20 ms 2284 KB Output isn't correct
2 Halted 0 ms 0 KB -