Submission #740605

# Submission time Handle Problem Language Result Execution time Memory
740605 2023-05-12T19:05:18 Z ALVIN Jakarta Skyscrapers (APIO15_skyscraper) PyPy 3
0 / 100
76 ms 20148 KB
#include <bits/stdc++.h>

using namespace std;

int main() {
  int n, m;
  cin >> n >> m;
  int b[m], p[m];
  for (int i = 0; i < m; i++) {
    cin >> b[i] >> p[i];
  }

  int ans = 0;
  for (int i = 0; i < m; i++) {
    if (b[i] == 0) {
      ans++;
      continue;
    }

    int minJumps = INT_MAX;
    for (int j = 0; j < m; j++) {
      if (b[j] == 0) {
        minJumps = min(minJumps, abs(b[i] - b[j]) / p[j]);
      }
    }
    ans += minJumps;
  }

  cout << ans << endl;

  return 0;
}

Compilation message

File "skyscraper.py", line 3
    using namespace std;
          ^
SyntaxError: invalid syntax
# Verdict Execution time Memory Grader output
1 Runtime error 76 ms 20128 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 61 ms 20112 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 64 ms 20088 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 66 ms 20140 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 68 ms 20148 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -