1 solutions

  • 0
    @ 2024-4-13 13:03:35

    #include #include #include <unordered_map>

    int main() { int n; std::cin >> n;

    std::vector<int> samples(n);
    std::unordered_map<int, int> frequency;
    
    for (int i = 0; i < n; ++i) {
        std::cin >> samples[i];
        if (samples[i] <= 100000) {
            frequency[samples[i]]++;
        }
    }
    
    for (int i = 0; i <= 100000; ++i) {
        std::cout << frequency[i] << " \n";
    }
    
    return 0;
    

    }

    50分

    • 1

    Information

    ID
    6911
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    1
    Tags
    # Submissions
    9
    Accepted
    5
    Uploaded By