# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1013137 |
2024-07-03T08:23:21 Z |
vjudge1 |
Checker (COCI19_checker) |
C++17 |
|
997 ms |
524288 KB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n>>n;
string s;
cin>>s;
vector<pair<int,int>> nei[n+1];
bitset<200000> edg[n][3],temp;
for (int i=0;i<n-1;i++)
{
nei[i].push_back({i+1,s[i]});
nei[i+1].push_back({i,s[i]});
edg[i][s[i]-'1'].set(i+1);
edg[i+1][s[i]-'1'].set(i);
}
nei[0].push_back({n-1,s[n-1]});
nei[n-1].push_back({0,s[n-1]});
edg[0][s[n-1]-'1'].set(n-1);
edg[n-1][s[n-1]-'1'].set(0);
for (int i=0;i<n-3;i++)
{
int u,v,w;
cin>>u>>v>>w;
u--,v--,w--;
nei[u].push_back({v,w});
nei[v].push_back({u,w});
edg[u][w].set(v);
edg[v][w].set(u);
}
int tr=0,ptr=0;
for (int u=0;u<n;u++)
{
for (auto i:nei[u])
for (int j=0;j<3;j++)
for (int k=0;k<3;k++)
{
temp=edg[u][j]&edg[i.first][k];
tr+=temp.count();
if (j!=k && i.second!=j && i.second!=k)
ptr+=temp.count();
}
}
tr/=6;
ptr/=6;
if (tr!=n-2)
cout<<"neispravna triangulacija"<<endl;
else if(ptr!=n-2)
cout<<"neispravno bojenje"<<endl;
else
cout<<"tocno"<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
7768 KB |
Output is correct |
2 |
Correct |
45 ms |
7512 KB |
Output is correct |
3 |
Correct |
45 ms |
7768 KB |
Output is correct |
4 |
Correct |
45 ms |
7512 KB |
Output is correct |
5 |
Correct |
46 ms |
7772 KB |
Output is correct |
6 |
Correct |
46 ms |
7516 KB |
Output is correct |
7 |
Correct |
60 ms |
7772 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
7768 KB |
Output is correct |
2 |
Correct |
45 ms |
7512 KB |
Output is correct |
3 |
Correct |
45 ms |
7768 KB |
Output is correct |
4 |
Correct |
45 ms |
7512 KB |
Output is correct |
5 |
Correct |
46 ms |
7772 KB |
Output is correct |
6 |
Correct |
46 ms |
7516 KB |
Output is correct |
7 |
Correct |
60 ms |
7772 KB |
Output is correct |
8 |
Correct |
924 ms |
147456 KB |
Output is correct |
9 |
Correct |
925 ms |
147628 KB |
Output is correct |
10 |
Correct |
997 ms |
147356 KB |
Output is correct |
11 |
Correct |
913 ms |
147388 KB |
Output is correct |
12 |
Correct |
906 ms |
147280 KB |
Output is correct |
13 |
Correct |
947 ms |
147284 KB |
Output is correct |
14 |
Correct |
933 ms |
147280 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
258 ms |
524288 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
243 ms |
524288 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
7768 KB |
Output is correct |
2 |
Correct |
45 ms |
7512 KB |
Output is correct |
3 |
Correct |
45 ms |
7768 KB |
Output is correct |
4 |
Correct |
45 ms |
7512 KB |
Output is correct |
5 |
Correct |
46 ms |
7772 KB |
Output is correct |
6 |
Correct |
46 ms |
7516 KB |
Output is correct |
7 |
Correct |
60 ms |
7772 KB |
Output is correct |
8 |
Correct |
924 ms |
147456 KB |
Output is correct |
9 |
Correct |
925 ms |
147628 KB |
Output is correct |
10 |
Correct |
997 ms |
147356 KB |
Output is correct |
11 |
Correct |
913 ms |
147388 KB |
Output is correct |
12 |
Correct |
906 ms |
147280 KB |
Output is correct |
13 |
Correct |
947 ms |
147284 KB |
Output is correct |
14 |
Correct |
933 ms |
147280 KB |
Output is correct |
15 |
Runtime error |
258 ms |
524288 KB |
Execution killed with signal 9 |
16 |
Halted |
0 ms |
0 KB |
- |