結果
| 問題 |
No.509 塗りつぶしツール
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-04 20:53:08 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 357 bytes |
| コンパイル時間 | 2,398 ms |
| コンパイル使用メモリ | 191,656 KB |
| 最終ジャッジ日時 | 2025-01-10 06:34:40 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(){
int f[128];
f['0']=1;
f['1']=0;
f['2']=0;
f['3']=0;
f['4']=1;
f['5']=0;
f['6']=1;
f['7']=0;
f['8']=2;
f['9']=1;
string s; cin>>s;
int m=s.length();
int hole=0;
rep(i,m) hole+=f[s[i]];
cout<<min(1+2*m+hole,2+m+2*hole)<<'\n';
return 0;
}