Submission #331704

# Submission time Handle Problem Language Result Execution time Memory
331704 2020-11-29T16:06:15 Z Trys_Like_Buffalo Potemkin cycle (CEOI15_indcyc) C++11
0 / 100
44 ms 4716 KB
#include <bits/stdc++.h>
# define M_PI  3.14159265358979323846
using namespace std;
//FILE *fi=freopen("1.txt","r",stdin);
//FILE *fi=freopen("1.inp","r",stdin);
//FILE *fo=freopen("1.out","w",stdout);
typedef pair <int,int> ii;
typedef pair <double,double> dd;
const int Maxn = 1010;
int a[Maxn][Maxn];
int n,m;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>n>>m;
    for(int i = 1;i<=m;i++)
    {
        int u,v;
        cin>>u>>v;
        a[u][v] = 1;
        a[v][u] = 1;
    }
    for(int u = 1;u<=n;u++)
    {
        for(int v = 1;v<=n;v++)
        {
            if(!a[u][v])
                continue;
            for(int k = 1;k<=n;k++)
            {
                if(!a[v][k] || a[u][k])
                    continue;
                for(int t = 1;t<=n;t++)
                {
                    if(!a[k][t] || a[v][t] || a[u][t])
                        continue;
                    cout<<u<<" "<<v<<" "<<k<<" "<<t<<"\n";
                    return 0;
                }
            }
        }
    }
    cout<<"no";
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Expected integer, but "no" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong adjacency
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong adjacency
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 748 KB Wrong adjacency
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 748 KB Wrong adjacency
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1516 KB Wrong answer on graph without induced cycle
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1516 KB Wrong adjacency
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 4716 KB Wrong adjacency
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 4460 KB Wrong adjacency
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 44 ms 2924 KB Wrong adjacency
2 Halted 0 ms 0 KB -