답안 #1053069

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1053069 2024-08-11T08:27:11 Z kunzaZa183 Newspapers (CEOI21_newspapers) C++17
0 / 100
0 ms 348 KB
#include <bits/stdc++.h>
using namespace std;
int main() { 
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(cin.failbit);
  int n,m;
  cin>>n>>m;
  const int maxn = 1000;
  vector<int> adjlist[maxn];
  for(int i=0;i<m;i++)
  {
    int a,b;
    cin>>a>>b;
    a--,b--;
    adjlist[a].push_back(b),adjlist[b].push_back(a);
  }
  if(n==1){
    cout<<"YES\n1\n1\n";
  } else if (n==2) {
    cout<<"YES\n2\n1 1\n";
  } else if (n == 3) {
    cout<<"YES\n2\n2 2\n";
  } else {
    cout<<"NO\n";
  }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -