Submission #984726

#TimeUsernameProblemLanguageResultExecution timeMemory
984726woodGame (IOI14_game)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> p32; typedef pair<ll,ll> p64; #define pb push_back #define eb emplace_back #define fi first #define se second #define vi vector<int> #define vp32 vector<p32> #define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL) #define MOD %1000000007 #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; //never guess //never debug without reviewing code //never try adding ones or substracting them //only step by step debug when necessay int N, mx; vi arr; void initialize(int n) { N = n; arr.resize(n,0); mx = n-1; } int hasEdge(int u, int v) { arr[u]++; arr[v]++; if(arr[u]==mx||arr[v]==mx){ return 1; } return 0; } int read_int() { int x; assert(scanf("%d", &x) == 1); return x; } int main() { int n, u, v; n = read_int(); initialize(n); for (int i = 0; i < n * (n - 1) / 2; i++) { u = read_int(); v = read_int(); if (hasEdge(u, v)) puts("1"); else puts("0"); } return 0; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccYW2jBz.o: in function `read_int()':
grader.cpp:(.text+0x0): multiple definition of `read_int()'; /tmp/cc48Rh5A.o:game.cpp:(.text+0x40): first defined here
/usr/bin/ld: /tmp/ccYW2jBz.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc48Rh5A.o:game.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status