結果
問題 | No.1692 Expectations |
ユーザー |
|
提出日時 | 2021-10-02 00:10:03 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 131 ms / 2,000 ms |
コード長 | 764 bytes |
コンパイル時間 | 1,507 ms |
コンパイル使用メモリ | 171,324 KB |
実行使用メモリ | 12,800 KB |
最終ジャッジ日時 | 2024-07-19 17:42:48 |
合計ジャッジ時間 | 3,031 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
#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; }