結果
問題 |
No.360 増加門松列
|
ユーザー |
|
提出日時 | 2019-10-12 16:02:05 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 366 bytes |
コンパイル時間 | 551 ms |
コンパイル使用メモリ | 69,376 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-28 01:59:15 |
合計ジャッジ時間 | 1,400 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 5 | main() | ^~~~
ソースコード
#include<iostream> #include<algorithm> using namespace std; int D[7]; main() { for(int i=0;i<7;i++)cin>>D[i]; sort(D,D+7); do{ bool flag=true; for(int i=1;i<6;i++) { flag&=D[i-1]<D[i+1]&&(D[i]<D[i-1]&&D[i]<D[i+1]||D[i]>D[i-1]&&D[i]>D[i+1]); } if(flag) { cout<<"YES"<<endl; return 0; } }while(next_permutation(D,D+7)); cout<<"NO"<<endl; }