Submission #222366

# Submission time Handle Problem Language Result Execution time Memory
222366 2020-04-13T05:29:44 Z dantoh000 Checker (COCI19_checker) C++14
0 / 110
161 ms 12544 KB
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> ii;
int col[200005];
vector<ii> adjlist[200005];
int main(){
    int st;
    scanf("%d",&st);
    int n;
    scanf("%d",&n);
    for (int i = 0; i < n; i++){
        char x;
        scanf(" %c",&x);
        col[i] = x-'0';
    }
    for (int i = 0; i < n-3; i++){
        int a,b,c;
        scanf("%d%d%d",&a,&b,&c);
        adjlist[a].push_back({b,c});
        adjlist[b].push_back({a,c});
    }
    int ct=  0;
    for (int i = 1; i <= n; i++){
        //printf("%d %d\n",i,adjlist[i].size());
        if ((int)adjlist[i].size() % 2 == 1){
            ct++;
        }
    }
    printf("%s",ct>2?"neispravna triangulacija":"tocno");
}

Compilation message

checker.cpp: In function 'int main()':
checker.cpp:8:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&st);
     ~~~~~^~~~~~~~~~
checker.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ~~~~~^~~~~~~~~
checker.cpp:13:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf(" %c",&x);
         ~~~~~^~~~~~~~~~
checker.cpp:18: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 Incorrect 7 ms 4992 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 4992 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 161 ms 12544 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 153 ms 12408 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 4992 KB Output isn't correct
2 Halted 0 ms 0 KB -