結果

問題 No.2153 何コーダーが何人?
ユーザー watasou1543watasou1543
提出日時 2022-12-10 13:51:52
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 2,654 bytes
コンパイル時間 2,180 ms
コンパイル使用メモリ 181,232 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-22 23:46:09
合計ジャッジ時間 2,570 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 3 ms
6,944 KB
testcase_03 AC 4 ms
6,940 KB
testcase_04 AC 3 ms
6,944 KB
testcase_05 AC 4 ms
6,948 KB
testcase_06 AC 4 ms
6,944 KB
testcase_07 AC 4 ms
6,944 KB
testcase_08 AC 3 ms
6,940 KB
testcase_09 AC 3 ms
6,944 KB
testcase_10 AC 4 ms
6,944 KB
testcase_11 AC 3 ms
6,940 KB
testcase_12 AC 3 ms
6,940 KB
testcase_13 AC 4 ms
6,944 KB
testcase_14 AC 3 ms
6,944 KB
testcase_15 AC 3 ms
6,944 KB
testcase_16 AC 4 ms
6,940 KB
testcase_17 AC 4 ms
6,940 KB
testcase_18 AC 4 ms
6,940 KB
testcase_19 AC 2 ms
6,944 KB
testcase_20 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
  }
}
0