Submission #211371

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2113712020-03-20 08:21:50shart23Dango Maker (JOI18_dango_maker)C++14
13 / 100
2093 ms1408 KiB
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
const int MAXN = 100;
vector<int> vin[MAXN][MAXN];
vector<int> g[MAXN * MAXN];
int used[MAXN * MAXN];
int nn[MAXN * MAXN];
int sm[MAXN * MAXN];
set<int> g2[MAXN * MAXN];
pair<int, int> dp[MAXN * MAXN];
void dfs3(int v, int p) {
used[v] = 3;
if (sm[v] > 1) {
dp[v].first = sm[v] / 2;
dp[v].second = sm[v] / 2;
} else {
dp[v].first = 1;
}
for (int u : g2[v]) {
if (u != p && used[u] != 3) {
dfs3(u, v);
dp[v].first += dp[u].second;
dp[v].second += max(dp[u].first, dp[u].second);
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

dango_maker.cpp: In function 'bool check(int)':
dango_maker.cpp:43:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < g[v].size(); i++) {
                     ~~^~~~~~~~~~~~~
dango_maker.cpp:44:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int j = i + 1; j < g[v].size(); j++) {
                             ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...