제출 #991631

#제출 시각아이디문제언어결과실행 시간메모리
991631aryan129월 (APIO24_september)C++17
0 / 100
1027 ms3008 KiB
#include "september.h" #include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; vector<int> g[N]; int value[N]; void dfs(int node) { for(int to: g[node]) { dfs(to); value[node] = max(value[node], value[to]); } } int solve(int N, int M, vector<int> F, vector<vector<int>> S) { for(int i = 1; i < N; i++) { g[F[i]].push_back(i); } for(int i = 0; i < M; i++) { for(int j = 0; j < N - 1; j++) { value[S[i][j]] = max(value[S[i][j]], j + 1); } } dfs(0); vector<int> values; for(int i = 1; i < N; i++) { values.push_back(value[i]); } sort(values.begin(), values.end()); int pos = 0; int cnt = 0; for(int i = 1; i <= N; i++) { while(pos != values.size() && values[pos] == i) { pos += 1; } if(i == pos) { cnt += 1; } } return cnt; }

컴파일 시 표준 에러 (stderr) 메시지

september.cpp: In function 'int solve(int, int, std::vector<int>, std::vector<std::vector<int> >)':
september.cpp:34:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |   while(pos != values.size() && values[pos] == i) {
      |         ~~~~^~~~~~~~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...