結果
問題 |
No.653 E869120 and Lucky Numbers
|
ユーザー |
![]() |
提出日時 | 2019-01-07 01:52:26 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 448 bytes |
コンパイル時間 | 482 ms |
コンパイル使用メモリ | 55,936 KB |
最終ジャッジ日時 | 2025-01-06 20:13:13 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 26 WA * 5 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:7:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%s", buf); | ~~~~~^~~~~~~~~~~
ソースコード
#include <cstdio> #include <cstdint> #include <string> int main() { char buf[32768]; scanf("%s", buf); std::string p = buf; if (p.length() == 1) return puts("No"), 0; while (p.length() > 1) { int b = p.back(); if (!('2' <= b && b <= '4')) break; p.pop_back(); --p.back(); } fprintf(stderr, "> %s\n", p.c_str()); for (int ch: p) if (!(ch == '6' || ch == '7')) return puts("No"), 0; puts("Yes"); }