답안 #575016

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
575016 2022-06-09T14:14:23 Z AJ00 슈퍼트리 잇기 (IOI20_supertrees) C++14
11 / 100
169 ms 23932 KB
#include <bits/stdc++.h>
#include "supertrees.h"
using namespace std;

int n;
const int MOD = 1000000007;
const int INF = 1e18;

int construct(vector<vector<int>> p){
    int n = p[0].size();
    vector<vector<int>> b;
    b.resize(n);
    for (int i = 0; i < n; i++){
        b[i].resize(n);
        for (int j = 0; j < n; j++){
            b[i][j] = 0;
        }
    }
    if (n == 1){
        build(b);
        return 1;
    }
    for (int i = 0; i < n; i++){
        if (i == 0){
            b[0][1] = 1;
        }
        else if (i == n-1){
            b[n-1][n-2] = 1;
        }
        else {
            b[i][i-1] = 1;
            b[i][i+1] = 1;
        }
    }
  /*  for (int i = 0; i < n; i++){
        for (int j = 0; j < n; j++){
            
        }
    }*/
    build(b);
    return 1;
}

Compilation message

supertrees.cpp:7:17: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
    7 | const int INF = 1e18;
      |                 ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 300 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 8 ms 1176 KB Output is correct
7 Correct 169 ms 23932 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 300 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 8 ms 1176 KB Output is correct
7 Correct 169 ms 23932 KB Output is correct
8 Incorrect 1 ms 212 KB Too many ways to get from 0 to 1, should be 0 found no less than 1
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Too many ways to get from 0 to 1, should be 0 found no less than 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 300 KB Too many ways to get from 0 to 1, should be 0 found no less than 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 300 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 8 ms 1176 KB Output is correct
7 Correct 169 ms 23932 KB Output is correct
8 Incorrect 1 ms 212 KB Too many ways to get from 0 to 1, should be 0 found no less than 1
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 300 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 8 ms 1176 KB Output is correct
7 Correct 169 ms 23932 KB Output is correct
8 Incorrect 1 ms 212 KB Too many ways to get from 0 to 1, should be 0 found no less than 1
9 Halted 0 ms 0 KB -