답안 #222392

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
222392 2020-04-13T06:22:10 Z cheeheng Checker (COCI19_checker) C++14
0 / 110
5 ms 768 KB
#include <bits/stdc++.h>
using namespace std;

char colour[100005];

int deg[100005];

int main(){
    int ST;
    scanf("%d", &ST);

    int N;
    scanf("%d", &N);

    scanf(" %s", colour);

    memset(deg, 0, sizeof(deg));
    for(int i = 0; i < N-3; i ++){
        int a, b, c;
        scanf("%d%d%d", &a, &b, &c);

        deg[a-1] ++;
        deg[b-1] ++;
    }

    int temp = 0;
    for(int i = 0; i < N; i ++){
        if(deg[i] > 0){
            temp = i;
            break;
        }
    }

    vector<int> v;
    for(int i = 0; i < N; i ++){
        if(deg[i] > 0){
            v.push_back(i);
        }
    }
    v.push_back(temp+N);

    for(int x: v){
        //printf("%d ", x);
    }

    if((int)v.size() > N-1){
        printf("neispravna triangulacija");
        return 0;
    }

    //printf("ok ");

    for(int i = 0; i < (int)v.size()-1; i ++){
        if(v[i+1] - v[i] > 2){
            printf("neispravna triangulacija");
            return 0;
        }
    }

    printf("tocno");
    return 0;
}

Compilation message

checker.cpp: In function 'int main()':
checker.cpp:42:13: warning: unused variable 'x' [-Wunused-variable]
     for(int x: v){
             ^
checker.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &ST);
     ~~~~~^~~~~~~~~~~
checker.cpp:13:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &N);
     ~~~~~^~~~~~~~~~
checker.cpp:15:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf(" %s", colour);
     ~~~~~^~~~~~~~~~~~~~~
checker.cpp:20:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d%d", &a, &b, &c);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 768 KB Output is correct
2 Correct 5 ms 768 KB Output is correct
3 Incorrect 5 ms 768 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 768 KB Output is correct
2 Correct 5 ms 768 KB Output is correct
3 Incorrect 5 ms 768 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 768 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 768 KB Output is correct
2 Correct 5 ms 768 KB Output is correct
3 Incorrect 5 ms 768 KB Output isn't correct
4 Halted 0 ms 0 KB -