結果
問題 | No.1285 ゴミ捨て |
ユーザー |
|
提出日時 | 2020-11-13 21:21:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 50 ms / 2,000 ms |
コード長 | 238 bytes |
コンパイル時間 | 579 ms |
コンパイル使用メモリ | 69,840 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-28 21:32:25 |
合計ジャッジ時間 | 1,936 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main() | ^~~~
ソースコード
#include<iostream> #include<algorithm> using namespace std; int N; int A[1<<17]; main() { cin>>N; for(int i=0;i<N;i++)cin>>A[i]; sort(A,A+N); for(int i=1;i<N;i++)if(A[i-1]+1==A[i]) { cout<<2<<endl; return 0; } cout<<1<<endl; }