Submission #1185234

#TimeUsernameProblemLanguageResultExecution timeMemory
1185234cpdreamerNewspapers (CEOI21_newspapers)C++20
4 / 100
0 ms328 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair
#define F first
#define all(v) v.begin(),v.end()
#define V vector
#define pb push_back
#define S second
void file() {
    freopen("input.txt.txt", "r", stdin);
    freopen("output.txt.txt", "w", stdout);
}

V<int>binary_rep(int n){
    V<int>vp;
    for(int i=0;i<30;i++){
        if(((1<<i)&n)!=0)
            vp.pb(1);
        else
            vp.pb(0);
    }
    return vp;
}
void solve() {
    int n;
    cin>>n;
    int m;
    cin>>m;
    for(int i=0;i<m;i++){
        int a,b;
        cin>>a>>b;
    }
    if(m==n-1) {
        cout << "YES" << endl;
        cout << 1 << endl;
        cout << 1 << endl;
    }
    else{
        cout<<"NO"<<endl;
    }
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //file();
    solve();
}

Compilation message (stderr)

newspapers.cpp: In function 'void file()':
newspapers.cpp:11:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     freopen("input.txt.txt", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
newspapers.cpp:12:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     freopen("output.txt.txt", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...