結果
問題 |
No.112 ややこしい鶴亀算
|
ユーザー |
|
提出日時 | 2020-06-10 08:52:52 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 533 bytes |
コンパイル時間 | 1,470 ms |
コンパイル使用メモリ | 98,164 KB |
最終ジャッジ日時 | 2025-01-11 00:44:45 |
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 WA * 12 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <set> #include <map> #include <math.h> using namespace std; typedef long long int ll; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; vector<int> x(n); for(int i=0;i<n;i++){ cin >> x[i]; } sort(x.begin(), x.end()); if(x[0]==x[n-1]){ if(2*(n-1)==x[0]){ printf("%d 0\n",n); } else{ printf("0 %d\n",n); } } else{ for(int i=1;i<n;i++){ if(x[i]>x[i-1]){ printf("%d %d\n",i,n-i); return 0; } } } }