Submission #344061

# Submission time Handle Problem Language Result Execution time Memory
344061 2021-01-05T05:21:18 Z beksultan04 Meetings (JOI19_meetings) C++14
17 / 100
2000 ms 492 KB
#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
//    }



    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 s = Query(i,j,k);
                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

meetings.cpp: In function 'void Solve(int)':
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;
      |                   ^~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 0 ms 364 KB Output is correct
5 Correct 0 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 0 ms 364 KB Output is correct
8 Correct 0 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Correct 1 ms 364 KB Output is correct
12 Correct 1 ms 364 KB Output is correct
13 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 0 ms 364 KB Output is correct
5 Correct 0 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 0 ms 364 KB Output is correct
8 Correct 0 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Correct 1 ms 364 KB Output is correct
12 Correct 1 ms 364 KB Output is correct
13 Correct 1 ms 364 KB Output is correct
14 Correct 4 ms 364 KB Output is correct
15 Correct 3 ms 364 KB Output is correct
16 Correct 3 ms 364 KB Output is correct
17 Correct 3 ms 364 KB Output is correct
18 Correct 4 ms 364 KB Output is correct
19 Correct 3 ms 364 KB Output is correct
20 Correct 3 ms 364 KB Output is correct
21 Correct 3 ms 364 KB Output is correct
22 Correct 2 ms 492 KB Output is correct
23 Correct 4 ms 384 KB Output is correct
24 Correct 7 ms 364 KB Output is correct
25 Correct 7 ms 384 KB Output is correct
26 Correct 18 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 0 ms 364 KB Output is correct
5 Correct 0 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 0 ms 364 KB Output is correct
8 Correct 0 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Correct 1 ms 364 KB Output is correct
12 Correct 1 ms 364 KB Output is correct
13 Correct 1 ms 364 KB Output is correct
14 Correct 4 ms 364 KB Output is correct
15 Correct 3 ms 364 KB Output is correct
16 Correct 3 ms 364 KB Output is correct
17 Correct 3 ms 364 KB Output is correct
18 Correct 4 ms 364 KB Output is correct
19 Correct 3 ms 364 KB Output is correct
20 Correct 3 ms 364 KB Output is correct
21 Correct 3 ms 364 KB Output is correct
22 Correct 2 ms 492 KB Output is correct
23 Correct 4 ms 384 KB Output is correct
24 Correct 7 ms 364 KB Output is correct
25 Correct 7 ms 384 KB Output is correct
26 Correct 18 ms 364 KB Output is correct
27 Incorrect 347 ms 492 KB Wrong Answer [2]
28 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3067 ms 492 KB Time limit exceeded
2 Halted 0 ms 0 KB -