Submission #35675497
Source Code Expand
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using pii = pair<int, int>;
int main() {
int n;
cin >> n;
vector<int> a(n);
rep(i, n) cin >> a[i];
vector<int> b = a;
sort(b.begin(), b.end());
b.erase(unique(b.begin(), b.end()), b.end());
vector<int> ans(n);
rep(i, n) {
int d = b.end() - upper_bound(b.begin(), b.end(), a[i]);
ans[d]++;
}
rep(i, n) cout << ans[i] << endl;
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - (K+1)-th Largest Number |
| User | icchipost |
| Language | C++ (GCC 9.2.1) |
| Score | 300 |
| Code Size | 556 Byte |
| Status | AC |
| Exec Time | 378 ms |
| Memory | 5584 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example0.txt, example1.txt, example2.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, example0.txt, example1.txt, example2.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 000.txt | AC | 350 ms | 5584 KiB |
| 001.txt | AC | 374 ms | 5464 KiB |
| 002.txt | AC | 365 ms | 5392 KiB |
| 003.txt | AC | 203 ms | 4560 KiB |
| 004.txt | AC | 154 ms | 4044 KiB |
| 005.txt | AC | 90 ms | 3700 KiB |
| 006.txt | AC | 372 ms | 5548 KiB |
| 007.txt | AC | 378 ms | 5464 KiB |
| 008.txt | AC | 375 ms | 5548 KiB |
| 009.txt | AC | 347 ms | 5428 KiB |
| 010.txt | AC | 347 ms | 5460 KiB |
| 011.txt | AC | 350 ms | 5460 KiB |
| 012.txt | AC | 352 ms | 5464 KiB |
| 013.txt | AC | 348 ms | 5368 KiB |
| 014.txt | AC | 373 ms | 5368 KiB |
| 015.txt | AC | 367 ms | 5428 KiB |
| 016.txt | AC | 363 ms | 5468 KiB |
| 017.txt | AC | 356 ms | 5416 KiB |
| 018.txt | AC | 363 ms | 5360 KiB |
| 019.txt | AC | 359 ms | 5416 KiB |
| 020.txt | AC | 362 ms | 5552 KiB |
| 021.txt | AC | 355 ms | 5428 KiB |
| 022.txt | AC | 358 ms | 5352 KiB |
| 023.txt | AC | 357 ms | 5360 KiB |
| example0.txt | AC | 5 ms | 3524 KiB |
| example1.txt | AC | 3 ms | 3496 KiB |
| example2.txt | AC | 2 ms | 3552 KiB |