Submission #899130

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8991302024-01-05 13:53:18duckindogLogičari (COCI21_logicari)C++14
110 / 110
137 ms35152 KiB
// from duckindog wth depression
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e5 + 10;
int n;
vector<int> ad[N];
bool dd[N];
int st, ed;
void locate(int u, int pre = 0) {
dd[u] = 1;
for (int v : ad[u]) {
if (v == pre) continue;
if (dd[v]) {
st = u, ed = v;
continue;
}
locate(v, u);
}
}
int f[N][2][2][2][2];
int dfs(int u, int pre, int sub, int par, int cst, int ced) {
if (u == ed && (par && cst || sub != ced)) return 1e6;
auto &ret = f[u][sub][par][cst][ced];
if (ret > -1) return ret; ret = sub;
bool seen = par;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In function 'long long int dfs(long long int, long long int, long long int, long long int, long long int, long long int)':
Main.cpp:26:23: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   26 |   if (u == ed && (par && cst || sub != ced)) return 1e6;
      |                   ~~~~^~~~~~
Main.cpp:29:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   29 |   if (ret > -1) return ret; ret = sub;
      |   ^~
Main.cpp:29:29: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   29 |   if (ret > -1) return ret; ret = sub;
      |                             ^~~
Main.cpp: In function 'int32_t main()':
Main.cpp:74:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   74 |     freopen("duck.inp", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:75:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   75 |     freopen("duck.out", "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...