답안 #781673

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
781673 2023-07-13T09:35:08 Z devariaota Naboj (COCI22_naboj) C++17
0 / 110
384 ms 19404 KB
#include<bits/stdc++.h>
using namespace std;
#define ioss ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pii pair<int, int>
#define fi first
#define se second
#define pb push_back
int n, m;
vector<int> adj[200004];
int main() {
    ioss;
    cin >> n >> m;
    set<int> tmp;
    for(int i = 0; i < m; i++) {
        int a, b; cin >> a >> b;
        tmp.insert(a);
        adj[a].pb(b);
        adj[b].pb(a);
    }

    if(tmp.size() == n) {
        cout << -1 << endl;
        return 0;
    }
    cout << n << endl;
    for(int i = 1; i <= n; i++) {
        if(tmp.count(i)) cout << i << " " << 1 << endl;
        else cout << i << " " << 0 << endl;
    }
}

Compilation message

naboj.cpp: In function 'int main()':
naboj.cpp:21:19: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   21 |     if(tmp.size() == n) {
      |        ~~~~~~~~~~~^~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 4948 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 384 ms 19404 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 4948 KB Output isn't correct
2 Halted 0 ms 0 KB -