結果
| 問題 |
No.2153 何コーダーが何人?
|
| コンテスト | |
| ユーザー |
watasou1543
|
| 提出日時 | 2022-12-10 13:51:52 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 2,654 bytes |
| コンパイル時間 | 1,797 ms |
| コンパイル使用メモリ | 184,672 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-14 23:37:10 |
| 合計ジャッジ時間 | 2,588 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 19 |
ソースコード
#pragma region watasou
/*
. ∧_∧ がばっ 寝る!
( ・ω・)
_| ⊃/(___ <⌒/ヽ-、___
/ └-(____/ /<_/____/
 ̄ ̄ ̄ ̄ ̄ ̄ ̄
the pen is mightier than the sword.
-エドワード・ブルワー=リットン-
KCLC44TH watasou1543 ver.2.0.
*/
#include <bits/stdc++.h>
using namespace std;
//マクロ宣言
#define rep(i, a, b) for (int i = a; i < b; i++)
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;
using V = vector<int>;
using I = int;
ll mod=998244353;
string Y = "Yes";
string N = "No";
#define gcd __gcd
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define fi first
#define se second
#define fix(n) fixed << setprecision(n)
#define print(n) cout << n << endl
#define in(n) cin >> n
//関数宣言
template <typename T>
inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); }
template <typename T>
inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); }
ll jou(ll N,ll k){
ll i=0;
ll p=N;
ll Ans=0;
while(k>=(1<<i)){
if(k&(1<<i)){
Ans+=p;
}
p*=p;
i++;
}
return Ans;
}
// 深さ優先探索
vector<bool> seen;
void dfs(const Graph &G, int v) {
seen[v] = true; // v を訪問済にする
// v から行ける各頂点 next_v について
for (auto next_v : G[v]) {
if (seen[next_v]) continue; // next_v が探索済だったらスルー
dfs(G, next_v); // 再帰的に探索
}
}
vector<pair<long long, long long> > pri(long long N) {
vector<pair<long long, long long> > res;
for (long long a = 2; a * a <= N; ++a) {
if (N % a != 0) continue;
long long ex = 0; // 指数
// 割れる限り割り続ける
while (N % a == 0) {
++ex;
N /= a;
}
// その結果を push
res.push_back({a, ex});
}
// 最後に残った数について
if (N != 1) res.push_back({N, 1});
return res;
}
//-------------------------------------------------------------------------
#pragma endregion watasou
int main(){
I n;
in(n);
vector<string>s(n);
V d(n);
rep(i,0,n){
cin >> s[i] >> d[i];
}
map<string,int>mp;
V co(9,0);
rep(i,0,n){
if(mp[s[i]]==0){
mp[s[i]]=d[i]+1;
co[mp[s[i]]]++;
}
else{
co[mp[s[i]]]--;
mp[s[i]]=d[i]+1;
co[mp[s[i]]]++;
}
}
rep(i,1,9){
cout << co[i] << endl;
}
}
watasou1543