結果
| 問題 |
No.653 E869120 and Lucky Numbers
|
| コンテスト | |
| ユーザー |
ats5515
|
| 提出日時 | 2018-02-23 22:43:48 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 866 bytes |
| コンパイル時間 | 609 ms |
| コンパイル使用メモリ | 82,764 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-09 20:04:20 |
| 合計ジャッジ時間 | 1,648 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 WA * 1 |
ソースコード
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
string S;
cin >> S;
//vector<int> A(N);
int res = 0;
int c = 0;
bool ok = true;
bool f = true;
for (int i = S.size() - 1; i >= 0; i--) {
int a = S[i] - '0';
a -= c;
c = 0;
if (a < 0) {
a += 10;
c++;
}
if (a == 2 || a == 3 || a == 4) {
c++;
if (!f) {
ok = false;
break;
}
}else if (a == 7 || a == 6) {
f = false;
}
else {
if (i == 0 && a == 0) {
}
else {
ok = false;
break;
}
}
}
if (c == 1) {
ok = false;
}
if (ok) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
}
ats5515