結果
| 問題 |
No.653 E869120 and Lucky Numbers
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-02-24 00:48:28 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 2,000 ms |
| コード長 | 981 bytes |
| コンパイル時間 | 5,190 ms |
| コンパイル使用メモリ | 222,632 KB |
| 実行使用メモリ | 9,728 KB |
| 最終ジャッジ日時 | 2024-09-13 18:17:25 |
| 合計ジャッジ時間 | 6,019 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 |
ソースコード
#include <iostream>
#include <cstdio>
#include <bitset>
#include <queue>
#include <stack>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <utility>
#include <string>
#include <algorithm>
#include <cmath>
#include <limits>
#include <regex>
using namespace std;
using ll=long long;
using vint=vector<int>;
using pint=pair<int,int>;
const double EPS = 1e-9;
const int inf = numeric_limits<int>::max();
#define rep(i,n) for(int i=0;i<int(n);++i)
#define REP(i,a,b) for(int i=int(a);i<int(b);++i)
#define SHOW(a) cout << #a << " = " << a << endl
#define ARR(a,i,n) for(int i=0;i<int(n);++i) cout << #a << "[" << i << "]" << " = " << a[i] << endl
bool judge(){
std::regex re1(R"(^1[345]*[234]$)");
std::regex re2(R"(^[67]*[78][345]*[234]$)");
string s;
cin >> s;
return std::regex_match(s, re1) || std::regex_match(s, re2);
}
void solve(){
if(judge()){
cout << "Yes" << endl;
}else{
cout << "No" << endl;
}
}
int main(){
solve();
return 0;
}