Submission #366745

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3667452021-02-15 08:36:56arnold518Village (BOI20_village)C++14
100 / 100
177 ms29864 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 1e5;
int N;
vector<int> adj[MAXN+10];
ll ans1, ans2;
int memo[MAXN+10];
int P1[MAXN+10], P2[MAXN+10];
int dp1[MAXN+10], dp2[MAXN+10];
int L[MAXN+10], cnt;
void dfs(int now, int bef)
{
L[now]=++cnt;
int chd=0;
bool flag=false;
pii p={987654321, -1};
for(int nxt : adj[now])
{
if(nxt==bef) continue;
chd++;
dfs(nxt, now);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Village.cpp: In function 'int main()':
Village.cpp:161:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  161 |   for(int j=0; j<V[i].size(); j++)
      |                ~^~~~~~~~~~~~
Village.cpp:200:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  200 |  for(int i=0; i<VV.size(); i++)
      |               ~^~~~~~~~~~
Village.cpp:202:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  202 |   for(int j=0; j<VV[i].size(); j++)
      |                ~^~~~~~~~~~~~~
Village.cpp:208:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
  208 |  for(int i=1; i<=N; i++) printf("%d ", P1[i]); printf("\n");
      |  ^~~
Village.cpp:208:48: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  208 |  for(int i=1; i<=N; i++) printf("%d ", P1[i]); printf("\n");
      |                                                ^~~~~~
Village.cpp:209:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
  209 |  for(int i=1; i<=N; i++) printf("%d ", P2[i]); printf("\n");
      |  ^~~
Village.cpp:209:48: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  209 |  for(int i=1; i<=N; i++) printf("%d ", P2[i]); printf("\n");
      |                                                ^~~~~~
Village.cpp:139:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  139 |  scanf("%d", &N);
      |  ~~~~~^~~~~~~~~~
Village.cpp:144:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  144 |   scanf("%d%d", &u, &v);
      |   ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...