답안 #427092

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
427092 2021-06-14T12:22:04 Z A_D Simurgh (IOI17_simurgh) C++14
0 / 100
1 ms 204 KB
#include "simurgh.h"
#include <bits/stdc++.h>
using namespace std;
int nn,mm;
vector<int> ret;
vector<int> vec;
void bc(int i)
{
//    cout<<i<<endl;
    if(vec.size()>mm){
        return;
    }
    if(i==nn){
        if(vec.size()!=mm){
            return;
        }
        for(auto x:vec)cout<<x<<" ";cout<<endl;
        int ans=count_common_roads(vec);
        cout<<ans<<endl;
        if(ans==mm)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=u.size();
    mm=n-1;
    bc(0);
    sort(ret.begin(),ret.end());
    return ret;
}

Compilation message

simurgh.cpp: In function 'void bc(int)':
simurgh.cpp:10:18: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   10 |     if(vec.size()>mm){
      |        ~~~~~~~~~~^~~
simurgh.cpp:14:22: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   14 |         if(vec.size()!=mm){
      |            ~~~~~~~~~~^~~~
simurgh.cpp:17:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   17 |         for(auto x:vec)cout<<x<<" ";cout<<endl;
      |         ^~~
simurgh.cpp:17:37: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   17 |         for(auto x:vec)cout<<x<<" ";cout<<endl;
      |                                     ^~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Security Violation! Don't try to hack
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Security Violation! Don't try to hack
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Security Violation! Don't try to hack
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Security Violation! Don't try to hack
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Security Violation! Don't try to hack
2 Halted 0 ms 0 KB -