結果
問題 |
No.791 うし数列
|
ユーザー |
![]() |
提出日時 | 2019-03-31 19:08:30 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 336 bytes |
コンパイル時間 | 461 ms |
コンパイル使用メモリ | 56,872 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 04:51:12 |
合計ジャッジ時間 | 1,198 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 8 WA * 7 |
ソースコード
#include <fstream> #include <iostream> int main() { //std::ifstream inf("Text.txt"); std::cin.rdbuf(inf.rdbuf()); int N; std::cin >> N; int ans = 0; while (1) { if (N == 1) { break; } if (N % 10 == 3) { ans++; N = N / 10; } else{ ans = -1; break; } } std::cout << ans << std::endl; return 0; }