Submission #576587

# Submission time Handle Problem Language Result Execution time Memory
576587 2022-06-13T08:20:09 Z AGE Checker (COCI19_checker) C++14
0 / 110
18 ms 23764 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 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])>min(x[j],y[j])&&max(x[i],y[i])>max(x[j],y[j]))
                ok=1;

            else if(min(x[i],y[i])<min(x[j],y[j])&&max(x[i],y[i])<max(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==z[i]||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 13 ms 23764 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 23764 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 23764 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 18 ms 23752 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 23764 KB Output isn't correct
2 Halted 0 ms 0 KB -