結果
問題 | No.998 Four Integers |
ユーザー |
![]() |
提出日時 | 2020-03-23 17:21:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 447 bytes |
コンパイル時間 | 1,970 ms |
コンパイル使用メモリ | 166,784 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 13:14:43 |
合計ジャッジ時間 | 3,047 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
#include <bits/stdc++.h> using ll = long long int; using namespace std; ll mod=1e9+7; int main(){ int a[4]; bool ans=0; for(int i=0;i<4;i++){ cin >> a[i]; } do{ for(int i=0;i<4;i++){ if(a[0]==a[1]-1 && a[1] == a[2]-1 && a[2]==a[3]-1){ans=1;} if(a[0]-1==a[1] && a[1]-1 == a[2] && a[2]-1==a[3]){ans=1;} } }while(next_permutation(a,a+4)); if(ans==1){cout << "Yes" << endl;}else{cout << "No" << endl;} }