結果
問題 |
No.1285 ゴミ捨て
|
ユーザー |
|
提出日時 | 2020-11-13 21:34:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 396 bytes |
コンパイル時間 | 1,595 ms |
コンパイル使用メモリ | 169,324 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-22 20:32:30 |
合計ジャッジ時間 | 2,998 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 1 WA * 21 |
ソースコード
#include <bits/stdc++.h> #define ll long long #define rep(i,x,n) for(ll i=x;i<n;i++) #define rrep(i,x,n) for(ll i=x;i>=n;i--) using namespace std; ll mod=1000000007; void solve(){ int n; cin>>n; int a[n]; rep(i,0,n) cin>>a[i]; sort(a,a+n); if(n%2==1) cout<<n/2+1<<endl; else{ if(n==2 && a[0]+1==a[1]) cout<<2<<endl; else cout<<n/2<<endl; } } int32_t main(){ solve(); }