Submission #42832

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
428322018-03-04 17:54:23alenam0161Simurgh (IOI17_simurgh)C++14
Compilation error
0 ms0 KiB
#include "simurgh.h"
#include <iostream>
#include <algorithm>
#include <cassert>
using namespace std;
#define DG(x) for(int i=0;i<(x).size();++i)cerr<<#x[i]<<" = "<<x[i]<<" ";
const int N = 5e2 + 7;
int used[N];
struct edge {
int ham, x;
};
vector<edge> g[N], ham[N],Nor[N];
vector<int> V, U;
bool is_it_in_T[N*N],Found[N*N];
int arj[N],Q[N];
int How[N*N];
int di[N];
int n,m;
void get_any(int v, vector<int> &T) {
used[v] = true;
for (auto to:g[v]) {
if (used[to.x])continue;
di[to.x] = di[v] + 1;
T.push_back(to.ham);
is_it_in_T[to.ham] = true;
get_any(to.x, T);
}
}
int par[N];
int find_par(int v) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

simurgh.cpp: In function 'int Newspantree(std::vector<int>&, std::vector<int>&)':
simurgh.cpp:43:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < cur.size(); ++i)Merge(V[cur[i]], U[cur[i]]);
                    ^
simurgh.cpp:45:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < T.size(); ++i) {
                    ^
In file included from /usr/include/c++/5/cassert:43:0,
                 from simurgh.cpp:4:
simurgh.cpp:51:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  assert(cur.size() == n - 1);
                    ^
simurgh.cpp: In function 'std::vector<int> find_roads(int, std::vector<int>, std::vector<int>)':
simurgh.cpp:101:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < u.size(); ++i) {
                    ^
simurgh.cpp:110:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < u.size(); ++i) {
                    ^
simurgh.cpp:114:32: error: 'memset' was not declared in this scope
    memset(used, 0, sizeof(used));
                                ^
simurgh.cpp:121:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int ii = 0; ii < Cikl.size(); ++ii) {
                        ^
simurgh.cpp:123:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int j = 0; j < Cikl.size(); ++j) {
                       ^
simurgh.cpp:130:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int ii = 0; ii < Cikl.size(); ++ii) {
                        ^
simurgh.cpp:136:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int ii = 0; ii < Cikl.size(); ++ii) {
                         ^
simurgh.cpp:141:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int ii = 0; ii < Cikl.size(); ++ii) {
                         ^
simurgh.cpp:158:30: error: 'memset' was not declared in this scope
  memset(used, 0, sizeof(used));
                              ^
simurgh.cpp:188:8: warning: unused variable 'ok' [-Wunused-variable]
    int ok = 0;
        ^
simurgh.cpp:209:7: warning: unused variable 'ok' [-Wunused-variable]
   int ok = 0;
       ^