#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cstdlib>
#include <climits>
#include <iomanip>
#include <cmath>
using namespace std;
constexpr int nmax = 1e3+2;
int n,m,x,y;
bool a[nmax][nmax];
void change(bool a[nmax][nmax],int x)
{
for(int i=1;i<=n;i++)
{
a[i][x] = (a[i][x] == true ? false:true);
a[x][i] = (a[x][i] == true ? false:true);
}
return;
}
bool verificare(bool a[nmax][nmax])
{
for(int i=1;i<=n;i++)
{
if(a[i][2]==false)
{
change(a,i);
}
}
for(int i=1;i<=n;i++)
{
for(int j=i+1;j<=n;j++)
{
if(a[i][j]==false)
{
return false;
}
}
}
return true;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cin>>n>>m;
for(int i=1;i<=m;i++)
{
cin>>x>>y;
a[x][y]=a[y][x]=true;
}
if(verificare(a)==true)
{
cout<<"DA"<<'\n';
return 0;
}
cout<<"NE"<<'\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
468 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
468 KB |
Output is correct |
2 |
Correct |
5 ms |
724 KB |
Output is correct |
3 |
Correct |
21 ms |
1236 KB |
Output is correct |
4 |
Incorrect |
34 ms |
1284 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |