Submission #1010630

#TimeUsernameProblemLanguageResultExecution timeMemory
1010630lrancicTrading (IZhO13_trading)C++17
0 / 100
2040 ms4708 KiB
#include <iostream> #include <vector> int main() { int n, m; std::cin >> n >> m; std::vector<int> prices(n+1); for (int i = 0; i < m; i++) { int l, r, x; std::cin >> l >> r >> x; for (; l <= r; l++, x++) prices[l] = std::max(prices[l], x); } for (int i = 1; i <= n; i++) std::cout << prices[i] << ' '; std::cout << '\n'; }

Compilation message (stderr)

trading.cpp: In function 'int main()':
trading.cpp:12:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   12 |  for (int i = 1; i <= n; i++) std::cout << prices[i] << ' '; std::cout << '\n';
      |  ^~~
trading.cpp:12:62: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   12 |  for (int i = 1; i <= n; i++) std::cout << prices[i] << ' '; std::cout << '\n';
      |                                                              ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...