Submission #222393

# Submission time Handle Problem Language Result Execution time Memory
222393 2020-04-13T06:22:47 Z cheeheng Checker (COCI19_checker) C++14
0 / 110
95 ms 2544 KB
#include <bits/stdc++.h>
using namespace std;

char colour[200005];

int deg[200005];

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);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 5 ms 1152 KB Output is correct
2 Correct 5 ms 1152 KB Output is correct
3 Incorrect 5 ms 1152 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 1152 KB Output is correct
2 Correct 5 ms 1152 KB Output is correct
3 Incorrect 5 ms 1152 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 81 ms 2396 KB Output is correct
2 Correct 79 ms 2416 KB Output is correct
3 Incorrect 76 ms 2544 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 78 ms 2416 KB Output is correct
2 Correct 74 ms 2480 KB Output is correct
3 Incorrect 95 ms 2416 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 1152 KB Output is correct
2 Correct 5 ms 1152 KB Output is correct
3 Incorrect 5 ms 1152 KB Output isn't correct
4 Halted 0 ms 0 KB -