Submission #827181

#TimeUsernameProblemLanguageResultExecution timeMemory
827181LeSonnnJousting tournament (IOI12_tournament)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define task "tournament" using namespace std; typedef long long ll; typedef pair <int, int> ii; #define fi first #define se second const int N = 1e6 + 9; ll n, m, k; set<ll> s; void progress() { cin >> n >> n >> m; for (int i = 1; i <= n; i++) { s.insert(i); } vector <ll> ans(n + 1), res; for ( ; m--;) { ll l, r, w; cin >> l >> r >> w; auto it = s.lower_bound(l); res.clear(); while (it != s.end() && *it <= r) { if (*it != w) { ans[*it] = w; res.emplace_back(*it); } it++; } for (auto i : res) { s.erase(i); } } for (int i = 1; i <= n; i++) { cout << ans[i] << " "; } } signed main() { // Author : Shyn_ ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); if(fopen(task ".inp", "r")) { freopen(task ".inp", "r", stdin); freopen(task ".out", "w", stdout); } ll nt(1); // cin >> nt; for ( ; nt--;) { progress(); } return 0; } /* LCG */

Compilation message (stderr)

tournament.cpp: In function 'int main()':
tournament.cpp:53:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   53 |         freopen(task ".inp", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
tournament.cpp:54:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   54 |         freopen(task ".out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccxAz099.o: in function `main':
tournament.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc2YWGqa.o:grader.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc2YWGqa.o: in function `main':
grader.cpp:(.text.startup+0x118): undefined reference to `GetBestPosition(int, int, int, int*, int*, int*)'
collect2: error: ld returned 1 exit status