結果

問題 No.182 新規性の虜
ユーザー hamrayhamray
提出日時 2017-11-16 18:14:52
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 582 bytes
コンパイル時間 628 ms
コンパイル使用メモリ 78,252 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-16 16:53:22
合計ジャッジ時間 2,035 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 21 ms
4,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 26 ms
4,380 KB
testcase_25 AC 15 ms
4,380 KB
testcase_26 AC 5 ms
4,376 KB
testcase_27 AC 1 ms
4,380 KB
evil01.txt AC 35 ms
4,380 KB
evil02.txt AC 36 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<algorithm>
#include<vector>
#include<math.h>
#include<stack>
#include <typeinfo>  
using namespace std;
int main(void){
    long long N, c; cin >> N;
    vector<int> v;
    int cnt = 0;
    for(int i = 0; i < N; i++){
        cin >> c;
        v.push_back(c);
    }
    int key = v[0];
    sort(v.begin(), v.end());
    for(int i = 1; i < N; i++){
        if(key != v[i]){
            cnt++;
            key = v[i];
        }
    }
    if(cnt > 0) cnt += 1;
    cout << cnt << endl;
    return 0;
}
    
0