結果
| 問題 | No.509 塗りつぶしツール |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-19 15:28:11 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 270 bytes |
| 記録 | |
| コンパイル時間 | 2,177 ms |
| コンパイル使用メモリ | 192,080 KB |
| 最終ジャッジ日時 | 2025-01-11 05:29:11 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0),ios::sync_with_stdio(false);
string n; cin>>n;
int cnt=1;
for(auto&&i:n){
if(i=='8')cnt+=2;
else if(i=='0'||i=='4'||i=='6'||i=='9')cnt+=1;
}
cout<<min(cnt*2+n.size(),cnt+n.size()*2)<<"\n"s;
}