zoukankan      html  css  js  c++  java
  • 【CS Round #39 (Div. 2 only) A】Removed Pages

    Link:

    Description

    Solution

    每读入一个x;
    把a[(x-1)/2]置为1即可;
    统计1的个数

    NumberOf WA


    Reviw


    Code

    /*
    
    */
    #include <bits/stdc++.h>
    #define int long long
    using namespace std;
    int n;
    int a[100000+100];
    
    main(){
        scanf("%lld",&n);
        for (int i = 1;i <= n;i++){
            int x;
            scanf("%lld",&x);
            a[(x-1)/2]++;
        }
        int cnt = 0;
        for (int i = 0;i <= (int) 1e5;i++)
            if (a[i])
                cnt++;
        printf("%lld
    ",cnt);
        return 0;
    }
    
  • 相关阅读:
    2
    1
    java10
    java8
    java9
    java7
    java6
    java5
    java4
    java3
  • 原文地址:https://www.cnblogs.com/AWCXV/p/7626160.html
Copyright © 2011-2022 走看看