| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1352525 | sally | PPP (EGOI23_ppp) | C++20 | 3095 ms | 3512 KiB |
// https://oj.uz/problem/view/EGOI23_ppp
#include<iostream>
#include<vector>
using namespace std;
#define winner first
#define loser second
typedef pair<int,int> pii;
int main() {
int N, M;
cin>>N>>M;
vector<pii> event(M);
for(int i=0; i<M; i++) {
int win, lose;
cin>>win>>lose;
event[i].winner = win;
event[i].loser = lose;
}
vector<int> ans(N, 0);
for(int medal = 0; medal<M; medal++) {
vector<int> cnt(N, 0);
int MAXN = N+1, MAX = 0;
int now = event[medal].winner;
cnt[now]++;
MAXN = now;
MAX = 1;
for(int i = medal+1; i<M; i++) {
if(event[i].loser!=now) {
cnt[now]++;
if(cnt[now] == MAX) MAXN = min(MAXN, now);
else if(cnt[now] > MAX) {
MAX = cnt[now];
MAXN = now;
}
continue;
}
now = event[i].winner;
cnt[now]++;
if(cnt[now] == MAX) MAXN = min(MAXN, now);
else if(cnt[now] > MAX) {
MAX = cnt[now];
MAXN = now;
}
}
ans[MAXN]++;
//cout<<"medal = "<<medal<<", winner = "<<MAXN<<"\n";
}
for(int i=0; i<N; i++) cout<<ans[i]<<' ';
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
