#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define sz(x) (int)x.size()
#define ALL(v) v.begin(),v.end()
#define MASK(k) (1LL << (k))
#define BIT(x, i) (((x) >> (i)) & 1)
#define oo (ll)1e18
#define INF (ll)1e9
#define MOD (ll)(1e9 + 7)
#include "supertrees.h"
using namespace std;
template<class T1, class T2>
bool maximize(T1 &a, T2 b){if(a < b){a = b; return true;} return false;}
template<class T1, class T2>
bool minimize(T1 &a, T2 b){if(a > b){a = b; return true;} return false;}
template<class T1, class T2>
void add(T1 &a, T2 b){a += b; if(a >= MOD) a -= MOD;}
template<class T1, class T2>
void sub(T1 &a, T2 b){a -= b; if(a < 0) a += MOD;}
template<class T>
void cps(T &v){sort(ALL(v)); v.resize(unique(ALL(v)) - v.begin());}
const int MAX = 1003;
int construct(vector<vector<int>> p){
int N = sz(p);
auto subtask1_check = [&]() -> bool{
for(int i = 0; i < N; i++){
for(int j = 0; j < N; j++){
if(p[i][j] != 1){
return false;
}
}
}
return true;
};
if(subtask1_check()){
vector<vector<int>> ans(N, vector<int>(N, 0));
for(int i = 1; i < N; i++){
ans[i - 1][i] = ans[i][i - 1] = 1;
}
build(ans);
return 1;
}
return 0;
}
// int main(){
// ios_base::sync_with_stdio(0); cin.tie(0);
// // freopen("ADVERT.inp","r",stdin);
// // freopen("ADVERT.out","w",stdout);
// // cout << delivery(3, 2, 8, {1, 2, 5});
// return 0;
// }
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
504 KB |
Output is correct |
6 |
Correct |
7 ms |
1192 KB |
Output is correct |
7 |
Correct |
118 ms |
24068 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
504 KB |
Output is correct |
6 |
Correct |
7 ms |
1192 KB |
Output is correct |
7 |
Correct |
118 ms |
24068 KB |
Output is correct |
8 |
Incorrect |
1 ms |
336 KB |
Answer gives possible 0 while actual possible 1 |
9 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Answer gives possible 0 while actual possible 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Answer gives possible 0 while actual possible 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
504 KB |
Output is correct |
6 |
Correct |
7 ms |
1192 KB |
Output is correct |
7 |
Correct |
118 ms |
24068 KB |
Output is correct |
8 |
Incorrect |
1 ms |
336 KB |
Answer gives possible 0 while actual possible 1 |
9 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
504 KB |
Output is correct |
6 |
Correct |
7 ms |
1192 KB |
Output is correct |
7 |
Correct |
118 ms |
24068 KB |
Output is correct |
8 |
Incorrect |
1 ms |
336 KB |
Answer gives possible 0 while actual possible 1 |
9 |
Halted |
0 ms |
0 KB |
- |