結果

問題 No.1692 Expectations
ユーザー da_ha_da_ha_
提出日時 2021-10-02 00:05:28
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 717 bytes
コンパイル時間 3,987 ms
コンパイル使用メモリ 169,232 KB
実行使用メモリ 12,780 KB
最終ジャッジ日時 2023-09-26 23:47:14
合計ジャッジ時間 4,234 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 50 ms
4,380 KB
testcase_11 AC 50 ms
4,380 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 12 ms
4,380 KB
testcase_15 AC 125 ms
8,708 KB
testcase_16 AC 12 ms
4,380 KB
testcase_17 AC 58 ms
6,596 KB
testcase_18 AC 22 ms
4,856 KB
testcase_19 AC 148 ms
9,292 KB
testcase_20 AC 121 ms
11,332 KB
testcase_21 AC 141 ms
12,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define sz(x) int(v.size())
typedef long long ll;
typedef pair<int,int> P;
const int inf=1000000007;
const int mod=1e9 + 7;
const double PI=3.14159265358979323846;
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};

int cans(bool f){
    if(f) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


int main() {
    int N,M;
    cin >> N >> M;
    set<int> s; 
    int unicnt = 0;
    int all = 0;
    int ans = 1;
    rep(i,N) {
	int a;
	cin >> a;
	if(i == 0) all = a;
	if(all != a) ans= 0;
	if(s.find(a) == s.end()) {
	    s.insert(a);
	    unicnt++;
	}	
    }
    cout << unicnt << " " <<  ans<<  endl;
}




0