Submission #1065344

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10653442024-08-19 06:29:02Mr_HusanboyFriend (IOI14_friend)C++17
Compilation error
0 ms0 KiB
#include "friend.h"
#include<vector>
#include <algorithm>
#include <iostream>
using namespace std;
// Find out best sample
vector<vector<int>> g;
vector<int> vis, col, mt;
void paint(int i, int c){
col[i] = c;
for(auto u : g[i]){
if(col[u]) {assert(col[u] == -c); continue;}
paint(u, -c);
}
}
bool kuhn(int i){
if(vis[i]) return false;
vis[i] = 1;
for(auto u : g[i]){
if(mt[u] == -1 || kuhn(mt[u])){
mt[u] = i;
return true;
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

friend.cpp: In function 'void paint(int, int)':
friend.cpp:17:15: error: 'assert' was not declared in this scope
   17 |   if(col[u]) {assert(col[u] == -c); continue;}
      |               ^~~~~~
friend.cpp:5:1: note: 'assert' is defined in header '<cassert>'; did you forget to '#include <cassert>'?
    4 | #include <iostream>
  +++ |+#include <cassert>
    5 | using namespace std;