Submission #344143

# Submission time Handle Problem Language Result Execution time Memory
344143 2021-01-05T07:46:49 Z beksultan04 Meetings (JOI19_meetings) C++14
0 / 100
313 ms 748 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];
set <int> g[2001];
void Solve(int N) {
    int x = Query(0, 1, 2),i,j,y=1;
    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 ;
    }
    map <pii,bool> mp;
    /// krasava -_0
    x=0;
    for (i=1;i<N;++i){
        int cnt=g[x].size();
        for (int to : g[x]){
            int s = Query(x,to,i);
            if (s == x){
                cnt--;
                continue;
            }
            if (s == to){
                x = s;
                i--;
                break;
            }
            else {
                g[x].erase(to);
                g[to].erase(x);
                g[x].insert(i);
                g[to].insert(i);
                g[i].insert(to);
                g[i].insert(x);
                break;
            }
            cnt--;
        }
        if (cnt == 0){
            g[x].insert(i);
            g[i].insert(x);
        }
    }


//    for (i=0;i<N;++i){
//        cout <<i<<"- ";
//        for (int to : g[i]){
//            if (to > i)
//            cout <<to<<" ";
//        }
//        endi;
//    }
    for (i=0;i<N;++i){
        for (int to : g[i]){
            if (to > i){
                Bridge(i,to);
            }
        }
    }


}









Compilation message

meetings.cpp: In function 'void Solve(int)':
meetings.cpp:22:30: warning: unused variable 'j' [-Wunused-variable]
   22 |     int x = Query(0, 1, 2),i,j,y=1;
      |                              ^
meetings.cpp:22:32: warning: unused variable 'y' [-Wunused-variable]
   22 |     int x = Query(0, 1, 2),i,j,y=1;
      |                                ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 492 KB Output is correct
2 Correct 1 ms 492 KB Output is correct
3 Correct 1 ms 492 KB Output is correct
4 Correct 1 ms 620 KB Output is correct
5 Correct 1 ms 492 KB Output is correct
6 Incorrect 1 ms 492 KB Wrong Answer [4]
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 492 KB Output is correct
2 Correct 1 ms 492 KB Output is correct
3 Correct 1 ms 492 KB Output is correct
4 Correct 1 ms 620 KB Output is correct
5 Correct 1 ms 492 KB Output is correct
6 Incorrect 1 ms 492 KB Wrong Answer [4]
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 492 KB Output is correct
2 Correct 1 ms 492 KB Output is correct
3 Correct 1 ms 492 KB Output is correct
4 Correct 1 ms 620 KB Output is correct
5 Correct 1 ms 492 KB Output is correct
6 Incorrect 1 ms 492 KB Wrong Answer [4]
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 313 ms 748 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -