結果
| 問題 |
No.509 塗りつぶしツール
|
| コンテスト | |
| ユーザー |
nanophoto12
|
| 提出日時 | 2017-08-18 23:12:00 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 984 bytes |
| コンパイル時間 | 962 ms |
| コンパイル使用メモリ | 101,060 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-14 15:01:41 |
| 合計ジャッジ時間 | 1,862 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
#include <cmath>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <functional>
#include <queue>
#include <iostream>
#include <string.h>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <cstdint>
#include <climits>
#include <unordered_set>
#include <sstream>
#include <stack>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
typedef tuple<int,int,int> t3;
using namespace std;
string s;
map<char,int> c;
int get1()
{
int count = (int)s.length() * 2;
count++;
for(auto e : s)
{
count += c[e];
}
return count;
}
int get2()
{
int count = (int)s.length();
count+=2;
for(auto e : s)
{
count += c[e]*2;
}
return count;
}
int main(){
cin >> s;
c['0'] = 1;
c['1'] = c['2'] = c['3'] = 0;
c['4'] = 1;
c['5'] = 0;
c['6'] = 1;
c['7'] = 0;
c['8'] = 2;
c['9'] = 1;
cout << min(get1(), get2()) << endl;
return 0;
}
nanophoto12