답안 #670852

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
670852 2022-12-10T20:56:46 Z Essa2006 Ronald (COCI17_ronald) C++14
120 / 120
38 ms 6092 KB
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define FF first
#define SS second
#define all(a) a.begin(), a.end()
#define mod (ll)(1000000007)
int main(){
    ios_base::sync_with_stdio(false);
    int n, m;
    cin>>n>>m;
    vector<vector<int>>E(n+1, vector<int>(n+1));
    while(m--){
        int u, v;
        cin>>u>>v;
        E[u][v]=E[v][u]=1;
    }
    vector<int>P(n+1);
    P[1]=1;
    for(int i=2;i<=n;i++)
        P[i]=E[1][i];
    string ans="DA";
    for(int i=1;i<=n;i++){
        for(int j=1;j<i;j++){
            if((P[i]+P[j])%2==E[i][j]%2){
                ans="NE";
                j=n+1, i=n+1;
                break;
            }
        }
    }
    cout<<ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 316 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 320 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 328 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 536 KB Output is correct
2 Correct 10 ms 1748 KB Output is correct
3 Correct 3 ms 724 KB Output is correct
4 Correct 3 ms 724 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 460 KB Output is correct
2 Correct 6 ms 1620 KB Output is correct
3 Correct 28 ms 5528 KB Output is correct
4 Correct 38 ms 6092 KB Output is correct