Submission #404982

#TimeUsernameProblemLanguageResultExecution timeMemory
404982CursedCodeTravelling Merchant (APIO17_merchant)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define int long long using namespace std; const int MAXN = 100 + 3, INF = 1000 * 1000 * 1000 + 123, MAXK = 1000 + 23; int n, m, kk, d[MAXN][MAXN], b[MAXN][MAXK], s[MAXN][MAXK]; long double ans; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(nullptr), cout.tie(nullptr); cin >> n >> m >> kk; for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) if (i != j) d[i][j] = INF; for (int i = 0; i < n; i++) for (int j = 0; j < kk; j++) cin >> b[i][j] >> s[i][j]; for (int i = 1; i < n; i++) for (int j = 0; j < kk; j++) if (b[i][j] != -1) return 0; { int v, w, t; for (int i = 0; i < m; i++) { cin >> v >> w >> t; d[--v][--w] = t; } } for (int k = 0; k < n; k++) for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) d[i][j] = min(d[i][j], d[i][k] + d[k][j]); for (int i = 1; i < n; i++) for (int j = 0; j < kk; j++) if (~b[0][j] && ~s[i][j]) ans = max(ans, (long double)(s[i][j] - b[0][j]) / (d[0][i] + d[i][0])); cout << (int)ans;

Compilation message (stderr)

merchant.cpp: In function 'int32_t main()':
merchant.cpp:23:18: error: expected '}' at end of input
   23 |  cout << (int)ans;
      |                  ^
merchant.cpp:7:16: note: to match this '{'
    7 | int32_t main() {
      |                ^