#include "supertrees.h"
#include <bits/stdc++.h>
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)(x).size()
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
int res[1000][1000];
int construct(vector<vi> p)
{
int n=sz(p);
vi circle,line;
set<int>cir,lin;
for (int i=0;i<n;i++)
{
for (int j=0;j<n;j++)
{
if (i==j)continue;
if (p[i][j]==2)
{
if (cir.count(i)==0)
{
cir.insert(i);
circle.pb(i);
}
if (cir.count(j)==0)
{
cir.insert(j);
circle.pb(j);
}
}
else if (p[i][j]==1)
{
if (lin.count(i)==0)
{
lin.insert(i);
line.pb(i);
}
if (lin.count(j)==0)
{
lin.insert(j);
line.pb(j);
}
}
}
}
if (sz(circle)==0)
{
for (int k=0;k<n;k++)
{
for (int i=0;i<n;i++)
{
if (k==i)continue;
if (p[k][i]==1)for (int j=0;j<n;j++)
{
if (p[k][j]!=p[i][j])return 0;
}
}
}
}
vector<vi>answer;
for (int i=0;i<n;i++)
{
vi v;
for (int j=0;j<n;j++)
{
if (i==j)v.pb(0);
else v.pb(p[i][j]);
}
answer.pb(v);
}
build(answer);
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
1 ms |
256 KB |
Output is correct |
3 |
Incorrect |
1 ms |
256 KB |
Too many ways to get from 0 to 2, should be 1 found no less than 2 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
1 ms |
256 KB |
Output is correct |
3 |
Incorrect |
1 ms |
256 KB |
Too many ways to get from 0 to 2, should be 1 found no less than 2 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
1 ms |
256 KB |
Output is correct |
3 |
Correct |
1 ms |
256 KB |
Output is correct |
4 |
Incorrect |
1 ms |
384 KB |
Answer gives possible 1 while actual possible 0 |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
256 KB |
Output is correct |
2 |
Incorrect |
1 ms |
256 KB |
Integer element b_i_j[2] equals to 2, violates the range [0, 1] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
1 ms |
256 KB |
Output is correct |
3 |
Incorrect |
1 ms |
256 KB |
Too many ways to get from 0 to 2, should be 1 found no less than 2 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
1 ms |
256 KB |
Output is correct |
3 |
Incorrect |
1 ms |
256 KB |
Too many ways to get from 0 to 2, should be 1 found no less than 2 |
4 |
Halted |
0 ms |
0 KB |
- |