Submission #303947

#TimeUsernameProblemLanguageResultExecution timeMemory
303947ignaciocantaConnecting Supertrees (IOI20_supertrees)C++14
11 / 100
239 ms22136 KiB
#include <bits/stdc++.h> using namespace std; using tint = long long; using ld = long double; #define forsn(i, s, n) for(int i = s; i < int(n); i++) #define forn(i, n) forsn(i, 0, n) using vi = vector<int>; #define pb push_back #define rsz resize #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() using pi = pair<int,int>; #define f first #define s second #define mp make_pair #define DBG(x) cerr << #x << " = " << x << endl; const int MOD = 1e9+7; const int MX = 1000005; const int INF = 1e9; const ld PI = acos(ld(-1)); void NACHO(string name = "rental"){ ios_base::sync_with_stdio(0); cin.tie(0); freopen((name+".in").c_str(), "r", stdin); freopen((name+".out").c_str(), "w", stdout); } #include "supertrees.h" int construct(std::vector<std::vector<int>> p) { //Primero, si hay un 3, es imposible //(Al menos no encontre un caso que rompiera, ya que siempre implica que hay un camino mas largo) int n = sz(p); bool ok = 1; forn(i, n){ forn(j, n){ if(p[i][j] == 3) ok = 0; } } if(!ok){ return 0; } vector<vi> g (n, vi (n, 0)); forn(i, n-1){ g[i][i+1] = g[i+1][i] = 1; } build(g); return 1; }

Compilation message (stderr)

supertrees.cpp: In function 'void NACHO(std::string)':
supertrees.cpp:31:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   31 |     freopen((name+".in").c_str(), "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
supertrees.cpp:32:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   32 |     freopen((name+".out").c_str(), "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...