Submission #604855

# Submission time Handle Problem Language Result Execution time Memory
604855 2022-07-25T10:26:53 Z Theo830 ICC (CEOI16_icc) C++17
0 / 100
360 ms 760 KB
    #include "icc.h"
    #include <bits/stdc++.h>
    using namespace std;
    typedef int ll;
    const ll INF = 1e9+7;
    const ll MOD = 998244353;
    typedef pair<ll,ll> ii;
    #define iii pair<ll,ii>
    #define f(i,a,b) for(ll i = a;i < b;i++)
    #define pb push_back
    #define vll vector<ll>
    #define F first
    #define S second
    #define all(x) (x).begin(), (x).end()
    ///I hope I will get uprating and don't make mistakes
    ///I will never stop programming
    ///sqrt(-1) Love C++
    ///Please don't hack me
    ///@TheofanisOrfanou Theo830
    ///Think different approaches (bs,dp,greedy,graphs,shortest paths,mst)
    ///Stay Calm
    ///Look for special cases
    ///Beware of overflow and array bounds
    ///Think the problem backwards
    ///CEOI 2016 day 1
    /*
    int query(int size_a, int size_b, int a[], int b[]){
        cout<<size_a<<" : ";
        f(i,0,size_a){
            cout<<a[i]<<" ";
        }
        cout<<"\n";
        cout<<size_b<<" : ";
        f(i,0,size_b){
            cout<<b[i]<<" ";
        }
        cout<<"\n";
        ll v;
        cin>>v;
        return v;
    }
    */
    vector<set<ll> >adj;
    ll posa = 0;
    void run(int N){
        ll n = N;
        adj.assign(n+5,set<ll>());
        while(1){
            bool stop = 0;
            ll posa = 0;
            ll a,b;
            f(i,1,n+1){
                f(j,i+1,n+1){
                    ll A[1] = {i};
                    ll B[1] = {j};
                    if(!adj[i].count(j) && query(1,1,A,B) == 1){
                        //adj[i].insert(j);
                       // adj[j].insert(i);
                        posa++;
                        a = i,b = j;
                    }
                }
            }
          	assert(posa == 1);
            adj[a].insert(b);
            adj[b].insert(a);
            setRoad(a,b);
        }
    }
    /*
    int main(){
        run(4);
    }
    */

Compilation message

icc.cpp: In function 'void run(int)':
icc.cpp:49:18: warning: unused variable 'stop' [-Wunused-variable]
   49 |             bool stop = 0;
      |                  ^~~~
# Verdict Execution time Memory Grader output
1 Correct 61 ms 468 KB Ok! 1379 queries used.
2 Runtime error 14 ms 760 KB Execution killed with signal 6
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 269 ms 476 KB Number of queries more than 5000 out of 2500
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 360 ms 476 KB Number of queries more than 4500 out of 2250
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 339 ms 484 KB Number of queries more than 4000 out of 2000
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 311 ms 480 KB Number of queries more than 3550 out of 1775
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 282 ms 480 KB Number of queries more than 3250 out of 1625
2 Halted 0 ms 0 KB -