답안 #1005497

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1005497 2024-06-22T13:53:16 Z vjudge1 Party (POI11_imp) C++17
45 / 100
1055 ms 65536 KB
//
//  main.cpp
//  IntensiveCamp 2 2024
//
//  Created by Ali AlSalman on 17/05/2024.
//
 
#include <bits/stdc++.h>
 
#define endl '\n'
 
using namespace std;

set<int> nodes;
set<pair<int, int>> edges;

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    
    
    int n, m;
    cin>>n>>m;
    for (int i = 1; i <= n; i++) nodes.insert(i);
    
    while (m--) {
        int a, b;
        cin>>a>>b;
        edges.insert({min(a, b), max(a, b)});
    }
    
    for (int i = 1; i <= n; i++) for (int j = i + 1; j <= n; j++) {
        if (nodes.find(i) != nodes.end() && nodes.find(j) != nodes.end() &&
            edges.find({i, j}) == edges.end()) { nodes.erase(i); nodes.erase(j); }
    }
    
    int reqRes = n / 3;
    for (auto node = nodes.begin(); reqRes--; node++) cout<<*node<<" "; cout<<endl;
}

Compilation message

imp.cpp: In function 'int main()':
imp.cpp:37:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   37 |     for (auto node = nodes.begin(); reqRes--; node++) cout<<*node<<" "; cout<<endl;
      |     ^~~
imp.cpp:37:73: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   37 |     for (auto node = nodes.begin(); reqRes--; node++) cout<<*node<<" "; cout<<endl;
      |                                                                         ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 604 KB Output is correct
4 Correct 1 ms 604 KB Output is correct
5 Correct 1 ms 604 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 856 KB Output is correct
2 Correct 35 ms 4916 KB Output is correct
3 Correct 37 ms 4956 KB Output is correct
4 Correct 35 ms 4956 KB Output is correct
5 Correct 35 ms 4952 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 19 ms 2908 KB Output is correct
2 Correct 170 ms 18564 KB Output is correct
3 Correct 226 ms 18516 KB Output is correct
4 Correct 170 ms 18640 KB Output is correct
5 Correct 184 ms 18388 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 48 ms 6224 KB Output is correct
2 Correct 622 ms 41412 KB Output is correct
3 Correct 556 ms 41180 KB Output is correct
4 Correct 498 ms 41308 KB Output is correct
5 Correct 553 ms 41552 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 118 ms 13396 KB Output is correct
2 Correct 843 ms 59472 KB Output is correct
3 Correct 1055 ms 59472 KB Output is correct
4 Correct 958 ms 59308 KB Output is correct
5 Correct 1041 ms 59472 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 492 ms 37164 KB Output is correct
2 Runtime error 851 ms 65536 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1029 ms 65392 KB Output is correct
2 Runtime error 904 ms 65536 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 894 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 856 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 869 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 931 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -