結果
問題 | No.360 増加門松列 |
ユーザー |
![]() |
提出日時 | 2017-08-13 22:53:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 694 bytes |
コンパイル時間 | 1,905 ms |
コンパイル使用メモリ | 169,068 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-24 04:39:03 |
合計ジャッジ時間 | 2,727 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~
ソースコード
#include<bits/stdc++.h> typedef long long ll; using namespace std; int INF = 1e9; int MOD = 1e9+7; main(){ int num[7]; for(int i = 0;i < 7;i++)cin >> num[i]; sort(num,num+7); for(int i = 0;i < 5040;i++){ for(int j = 0;j <= 4;j++){ if(num[j] == num[j+1] || num[j+1] == num[j+2] || num[j+2] == num[j])break; if(num[j] > num[j+2])break; if(!((num[j+1] > num[j] && num[j+1] > num[j+2])|| (num[j+1] < num[j] && num[j+1] < num[j+2])))break; if(j == 4){ cout << "YES" << endl; return 0; } } next_permutation(num,num+7); } cout << "NO" << endl; }