Submission #427123

# Submission time Handle Problem Language Result Execution time Memory
427123 2021-06-14T12:33:58 Z A_D Simurgh (IOI17_simurgh) C++14
0 / 100
3000 ms 204 KB
#include "simurgh.h"
#include <bits/stdc++.h>
using namespace std;
int nn,mm;
vector<int> ret;
vector<int> vec;
vector<int> vec2;
int h=0;
void bc(int i)
{
    if(i==mm){
        if(vec.size()==nn-1){
            vec2=vec;
            h++;
            if(h==30001)assert(0);
            int ans=count_common_roads(vec2);
            if(ans==nn-1)ret=vec;
        }
        return;
    }
    vec.push_back(i);
    bc(i+1);
    vec.pop_back();
    bc(i+1);
}
vector<int> find_roads(int n,vector<int> u,vector<int> v){
    ret.clear();vec.clear();
    nn=n;
    mm=u.size();
    bc(0);
    sort(ret.begin(),ret.end());
    return ret;
}

Compilation message

simurgh.cpp: In function 'void bc(int)':
simurgh.cpp:12:22: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   12 |         if(vec.size()==nn-1){
      |            ~~~~~~~~~~^~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB WA in grader: NO
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB WA in grader: NO
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB WA in grader: NO
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB correct
2 Execution timed out 3056 ms 204 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB WA in grader: NO
2 Halted 0 ms 0 KB -