Submission #344064

#TimeUsernameProblemLanguageResultExecution timeMemory
344064beksultan04Meetings (JOI19_meetings)C++14
Compilation error
0 ms0 KiB
#include "meetings.h" #include "grader.cpp" #include <bits/stdc++.h> #define ll long long #define pii pair<int,int> #define OK puts("OK"); #define NO puts("NO"); #define YES puts("YES"); #define fr first #define sc second #define ret return #define all(s) s.begin(),s.end() #define allr(s) s.rbegin(),s.rend() #define pb push_back #define sz(v) (int)v.size() #define endi puts(""); using namespace std; bool vis[2001],voobshe[2001]; void Solve(int N) { int x = Query(0, 1, 2); if (N == 3){ if (x == 0){ Bridge(0,1); Bridge(0,2); } else if (x == 1){ Bridge(1,2); Bridge(0,1); } else { Bridge(0,2); Bridge(1,2); } ret ; } int y = 1,i,j,cnt=0,k; // if (x == 1)y = 0; // vis[x]=1; // vis[y]=1; // while (1){ // for (i=0;i<N;++i){ // if (vis[i])continue; // int s = Query(x,y,i); // if (s != x && s != y && voobshe[s] == 0){ // y = s; // for (j=0;j<N;++j) // vis[j]=0; // vis[x]=1; // vis[y]=1; // } // } // cout <<x<<" "<<y<<"\n"; // voobshe[x]=1; // x = y; // while (voobshe[y] || x == y){ // y++; // y %= N; // } // vis[x]=1; // vis[y]=1; // OK // } map <pair<pii,int>,int > mp; for (i=0;i<N;++i){ for (j=i+1;j<N;++j){ vis[i]=1;vis[j]=1; bool f=1; for (k=0;k<N;++k){ if (vis[k])continue; int a = i,b = j,c = k; /// our sort -_0 int s ; if (a > b)swap(a,b);if (b > c)swap(b,c);if (a > b)swap(a,b);if (a > b)swap(a,b);if (b > c)swap(b,c);if (a > b)swap(a,b); if (mp.count({{a,b},c})==0){ s = Query(i,j,k); mp[{{a,b},c}] = s; } else s = mp[{{a,b},c}]; if (s != i && s != j){ f=0; break; } vis[k]=1; } if (f){ Bridge(i, j); } for (k=0;k<N;++k)vis[k] = 0; } } }

Compilation message (stderr)

meetings.cpp: In function 'void Solve(int)':
meetings.cpp:77:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   77 |                 if (a > b)swap(a,b);if (b > c)swap(b,c);if (a > b)swap(a,b);if (a > b)swap(a,b);if (b > c)swap(b,c);if (a > b)swap(a,b);
      |                 ^~
meetings.cpp:77:37: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   77 |                 if (a > b)swap(a,b);if (b > c)swap(b,c);if (a > b)swap(a,b);if (a > b)swap(a,b);if (b > c)swap(b,c);if (a > b)swap(a,b);
      |                                     ^~
meetings.cpp:37:9: warning: unused variable 'y' [-Wunused-variable]
   37 |     int y = 1,i,j,cnt=0,k;
      |         ^
meetings.cpp:37:19: warning: unused variable 'cnt' [-Wunused-variable]
   37 |     int y = 1,i,j,cnt=0,k;
      |                   ^~~
/tmp/cchNGAgn.o: In function `Query(int, int, int)':
grader.cpp:(.text+0x110): multiple definition of `Query(int, int, int)'
/tmp/ccbVvmOq.o:meetings.cpp:(.text+0x110): first defined here
/tmp/cchNGAgn.o: In function `Bridge(int, int)':
grader.cpp:(.text+0x240): multiple definition of `Bridge(int, int)'
/tmp/ccbVvmOq.o:meetings.cpp:(.text+0x240): first defined here
/tmp/cchNGAgn.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccbVvmOq.o:meetings.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status