| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1353864 | JungPS | 9월 (APIO24_september) | C++20 | 87 ms | 7164 KiB |
#include "september.h"
#include <bits/stdc++.h>
using namespace std;
int degree[5][100007];
int solve(int N, int M, std::vector<int> F, std::vector<std::vector<int>> S) {
for(int i=0;i<N;++i) for(int c=0;c<M;++c) degree[c][i]=0;
for(int i=1;i<N;++i) for(int c=0;c<M;++c) ++degree[c][F[i]];
multiset<pair<int,int>,greater<pair<int,int>>> st[M];
int cnt=0;
for(int r=0;r<N-1;++r){
for(int c=0;c<M;++c){
if(st[c].count({degree[c][F[S[c][r]]],F[S[c][r]]})){
st[c].erase({degree[c][F[S[c][r]]],F[S[c][r]]});
st[c].insert({degree[c][F[S[c][r]]]-1,F[S[c][r]]});
}
--degree[c][F[S[c][r]]];
st[c].insert({degree[c][S[c][r]],S[c][r]});
}
bool ok=true;
for(int c=0;c<M;++c){
if((*st[c].begin()).first!=0){
ok=false;
}
}
if(ok){
for(int c=0;c<M;++c) st[c].clear();
++cnt;
}
}
return cnt;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
