結果

問題 No.2153 何コーダーが何人?
ユーザー ikepyonikepyon
提出日時 2022-12-26 09:41:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 2,943 bytes
コンパイル時間 2,007 ms
コンパイル使用メモリ 185,392 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-30 20:07:27
合計ジャッジ時間 2,878 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#define whole(v) (v).begin(),(v).end()
#define rwhole(v) (v).rbegin(),(v).rend()
#define press(v) (v).erase(unique(whole(v)),(v).end())
#define Yes cout<<"Yes"<<endl; return 0
#define No cout<<"No"<<endl; return 0
#define vint vector<int>
#define vll vector<ll>
#define vpint vector<pair<int,int>>
#define vvint vector<vector<int>>
#define vvll vector<vector<ll>>
#define pqint priority_queue<int>
#define pqpint priority_queue<pair<int,int>>
#define rpqint priority_queue<int,vector<int>,greater<int>>
#define rpqpint priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>>
using namespace std;
using ll = long long;
int mod107 = 1000000007, mod998 = 998244353;
string alphabet = "abcdefghijklmnopqrstuvwxyz", ALFHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

//(a,b)と(c,d)の距離
double pyth(ll a, ll b, ll c, ll d) {
    double l = sqrt((a - c) * (a - c) + (b - d) * (b - d));
    return l;
}

//aのb乗をmで割った余り(a,bは非負整数,mは自然数)
int power(ll a, ll b, int m) {
    int k = 0, ans = 1;
    vector<ll> v(100);
    v[0] = a;
    for (int i = 1; i < 100; i++)
        v[i] = v[i - 1] * v[i - 1] % m;
    while (b > 0) {
        if (b % 2)
            ans = ans * v[k] % m;
        k++; b /= 2;
    }
    return ans;
}

//素数判定 O(sqrt(n))
bool prime_judge(ll n) {
    for (int i = 2; i <= sqrt(n); i++) {
        if (n % i == 0) {
            return false;
        }
    }
    return true;
}

int main() {
    int n;
    cin >> n;
    set<string> per;
    map<int, int> num;
    map<string, int> col;

    for (int i = 0; i < n; i++) {
        string s;
        int c;
        cin >> s >> c;
        col[s] = c;
        per.insert(s);
    }

    for (string s : per) {
        num[col[s]]++;
    }

    for (int i = 0; i < 8; i++) {
        cout << num[i] << endl;
    }
}
0