Submission #222392

#TimeUsernameProblemLanguageResultExecution timeMemory
222392cheehengChecker (COCI19_checker)C++14
0 / 110
5 ms768 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...