Submission #222480

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2224802020-04-13 08:11:25dantoh000Checker (COCI19_checker)C++14
110 / 110
781 ms75932 KiB
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> ii;
unordered_map<int, unordered_map<int, int> > adjmat;
vector<ii> adjlist[200005];
int st, n;
vector<ii> edg;
int f1, f2;
void addedge(int a, int b, int c){
adjmat[a][b] = adjmat[b][a] = c;
adjlist[a].push_back({b,c});
adjlist[b].push_back({a,c});
if (a > b) swap(a,b);
edg.push_back({a,b});
}
int cur;
bool cmp(ii a, ii b){
return (n+a.first-cur)%n < (n+b.first-cur)%n;
}
int main(){
scanf("%d",&st);
scanf("%d",&n);
f1 = f2 = 1;
for (int i = 1; i <= n; i++){
char x;
scanf(" %c",&x);
addedge(i,i%n+1,x-'0');
}
for (int i = 0; i < n-3; i++){
int a,b,c;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

checker.cpp: In function 'int main()':
checker.cpp:48:19: warning: variable 'x' set but not used [-Wunused-but-set-variable]
         for (auto x : adjlist[i]){
                   ^
checker.cpp:21:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&st);
     ~~~~~^~~~~~~~~~
checker.cpp:22:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ~~~~~^~~~~~~~~
checker.cpp:26:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf(" %c",&x);
         ~~~~~^~~~~~~~~~
checker.cpp:31: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...