제출 #993535

#제출 시각아이디문제언어결과실행 시간메모리
993535abczz9월 (APIO24_september)C++17
59 / 100
89 ms9536 KiB
#include "september.h" #include <iostream> #include <vector> #define ll long long using namespace std; bool B[100000][5]; ll f, in[100000][5], cnt; int solve(int N, int M, std::vector<int> F, std::vector<std::vector<int>> S) { f = cnt = 0; for (int i=1; i<N; ++i) { for (int j=0; j<M; ++j) { B[i][j] = 0; ++in[F[i]][j]; } } for (int i=0; i<N-1; ++i) { for (int j=0; j<M; ++j) { auto u = S[j][i]; B[u][j] = 1; --in[F[u]][j]; if (B[F[u]][j] && !in[F[u]][j]) --cnt; if (in[u][j]) ++cnt; } if (!cnt) ++f; } return f; }
#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...