Submission #346023

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3460232021-01-09 03:40:22nextgenxingRace (IOI11_race)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
#define f first
#define s second
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define F0R(i, x) FOR(i, 0, x)
const int MAX_N = 200001;
const int MAX_K = 1000001;
const int INF = 0x3f3f3f3f;
void setIO(string name = "race2") {
ios_base::sync_with_stdio(0); cin.tie(0);
freopen((name+".in").c_str(), "r", stdin);
freopen((name+".out").c_str(), "w", stdout);
}
int n, k, ans = INF;
int sz[MAX_N], depth[MAX_N], dist[MAX_N], mins[MAX_K];
bitset<MAX_N> removed;
bitset<MAX_K> done;
vector<pii> tree[MAX_N];
queue<pii> q;
int dfs(int curr, int par = -1){
sz[curr] = 1;
for(pii child : tree[curr]){
if(child.f == par || removed[child.f]) continue;
sz[curr]+=dfs(child.f, curr);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

race.cpp: In function 'void setIO(std::string)':
race.cpp:15:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   15 |     freopen((name+".in").c_str(), "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
race.cpp:16:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   16 |     freopen((name+".out").c_str(), "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
race.cpp: In function 'int main(int, const char**)':
race.cpp:46:27: warning: 'C' may be used uninitialized in this function [-Wmaybe-uninitialized]
   46 |         int ms = dfs(cr), C; q.push({cr, -1});
      |                           ^
/tmp/ccJv09kD.o: In function `main':
race.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccLYOuF9.o:grader.cpp:(.text.startup+0x0): first defined here
/tmp/ccLYOuF9.o: In function `main':
grader.cpp:(.text.startup+0x24): undefined reference to `best_path(int, int, int (*) [2], int*)'
collect2: error: ld returned 1 exit status