# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
576640 |
2022-06-13T08:49:26 Z |
AGE |
Checker (COCI19_checker) |
C++14 |
|
3000 ms |
104632 KB |
#include <bits/stdc++.h>
#define int long long
#define F first
#define S second
#define pb push_back
using namespace std;
const int N=1e6,M=3e3+2,mod=1e9+7;
int out[N];
int x[N],y[N],z[N];
vector< pair< int,int> >adj[N];
main()
{
int xx;
cin>>xx;
int n;
cin>>n;
string s;
cin>>s;
map< pair<int,int> , pair<int,int> > mp;
for(int i=1;i<=n;i++){
if(i==n)
mp[{n,1}]={1,s[i-1]-'0'},mp[{1,n}]={1,s[i-1]-'0'};
mp[{i,i+1}]={1,s[i-1]-'0'};
mp[{i+1,i}]={1,s[i-1]-'0'};
}
for(int i=0;i<n-3;i++){
cin>>x[i]>>y[i]>>z[i];
adj[x[i]].pb({y[i],z[i]});
adj[y[i]].pb({x[i],z[i]});
mp[{x[i],y[i]}]={1,z[i]};
mp[{y[i],x[i]}]={1,z[i]};
}
int ok=0;
for(int i=0;i<n-3;i++){
for(int j=0;j<n-3;j++){
if(i==j)
continue;
if((min(x[i],y[i])<max(x[j],y[j]))&&(max(x[i],y[i])>max(x[j],y[j]))&&(min(x[i],y[i])>min(x[j],y[j])))
ok=1;
}
}
int ok2=0;
for(int i=0;i<n-3;i++){
for(int j=1;j<=n;j++){
if(j==x[i]||j==y[i])
continue;
pair<int,int> p;
p={0,0};
if((mp[{x[i],j}]. F!=0)&&(mp[{y[i],j}].F!=0)){
if((mp[{x[i],j}].S==mp[{y[i],j}].S)||(mp[{x[i],j}].S==mp[{x[i],y[i]}].S)||(mp[{y[i],j}].S==z[i]))
ok2=1;
}
}
}
if(ok2==0&&ok==0)
cout<<"tecno"<<endl;
else if(ok==0&&ok2==1)
cout<<"neispravno bojenje"<<endl;
else
cout<<"neispravna triangulacija"<<endl;
return 0;
}
Compilation message
checker.cpp:12:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
12 | main()
| ^~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
14 ms |
24148 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
14 ms |
24148 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3051 ms |
104632 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3075 ms |
104172 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
14 ms |
24148 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |