結果

問題 No.1692 Expectations
ユーザー da_ha_da_ha_
提出日時 2021-10-02 00:10:03
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 162 ms / 2,000 ms
コード長 764 bytes
コンパイル時間 1,873 ms
コンパイル使用メモリ 169,416 KB
実行使用メモリ 12,796 KB
最終ジャッジ日時 2023-09-27 00:00:39
合計ジャッジ時間 3,573 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 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,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 51 ms
4,376 KB
testcase_11 AC 49 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 11 ms
4,376 KB
testcase_15 AC 135 ms
8,580 KB
testcase_16 AC 11 ms
4,380 KB
testcase_17 AC 59 ms
6,524 KB
testcase_18 AC 22 ms
4,788 KB
testcase_19 AC 162 ms
9,264 KB
testcase_20 AC 120 ms
11,356 KB
testcase_21 AC 142 ms
12,796 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++;
	}	
    }
    if(ans ==1) {
	if(M >= N+1) ans = 0;
    }
    cout << unicnt << " " <<  ans<<  endl;
}




0