#pragma region watasou /* .   ∧_∧ がばっ     寝る!    ( ・ω・)    _| ⊃/(___  <⌒/ヽ-、___ / └-(____/ /<_/____/  ̄ ̄ ̄ ̄ ̄ ̄ ̄ the pen is mightier than the sword. -エドワード・ブルワー=リットン- KCLC44TH watasou1543 ver.2.0. */ #include 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; using pli = pair; using pll = pair; using Graph = vector>; using V = vector; 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 inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); } template 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< 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 > pri(long long N) { vector > 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); vectors(n); V d(n); rep(i,0,n){ cin >> s[i] >> d[i]; } mapmp; 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; } }