Submission #613833

# Submission time Handle Problem Language Result Execution time Memory
613833 2022-07-30T11:55:09 Z Mr_Husanboy Simurgh (IOI17_simurgh) C++14
0 / 100
5 ms 320 KB
#include "simurgh.h"
#include<bits/stdc++.h>

using namespace std;
#define all(a) (a).begin(), (a).end()
#define vi vector<int>
#define ff first
#define ss second


vector<pair<int,int>> g[1005];

vector<int> find_roads(int n, vector<int> u, vector<int> v) {
    int m = u.size();
    for(int i = 0; i <(1<<m); i++){
        vector<int> tem;
        vector<int> vis(n);
        for(int j = 0; j < m; j++){
            if(i & (1 << j)){
                tem.push_back(j); vis[u[j]] = vis[v[j]] = 1;
            }
        }
        int cnt = 0;
        for(auto u : vis) cnt += u;
        if(tem.size() == n-1 && cnt == n){
            //cout << "H " << endl;
         //   for(auto u:tem) cout << u << ' '; cout << endl;
            if(count_common_roads(tem) == n-1) return tem;
        }
    }
}

Compilation message

simurgh.cpp: In function 'std::vector<int> find_roads(int, std::vector<int>, std::vector<int>)':
simurgh.cpp:25:23: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   25 |         if(tem.size() == n-1 && cnt == n){
      |            ~~~~~~~~~~~^~~~~~
simurgh.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: NO
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: NO
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: NO
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB correct
2 Incorrect 5 ms 320 KB WA in grader: NO
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: NO
2 Halted 0 ms 0 KB -