結果
問題 | No.509 塗りつぶしツール |
ユーザー |
![]() |
提出日時 | 2020-01-12 14:28:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 403 bytes |
コンパイル時間 | 1,799 ms |
コンパイル使用メモリ | 166,280 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-29 02:18:46 |
合計ジャッジ時間 | 3,021 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 16 WA * 11 |
ソースコード
#include<bits/stdc++.h> using namespace std; #ifdef LOCAL_DEBUG #include "LOCAL_DEBUG.hpp" #endif #define int long long signed main(){ int n; cin >> n; int cnt = 0, ana = 0; while(n > 0){ if(n % 10 == 6 || n % 10 == 9 || n % 10 == 0 || n % 10 == 4) ana++; if(n % 10 == 8) ana += 2; n /= 10; cnt++; } cout << min(2 * cnt + ana, 2 * (ana + 1) + cnt) << endl; return 0; }