結果
| 問題 |
No.509 塗りつぶしツール
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-06-23 09:47:15 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 678 bytes |
| コンパイル時間 | 665 ms |
| コンパイル使用メモリ | 75,276 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-02 13:18:00 |
| 合計ジャッジ時間 | 1,487 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 21 WA * 6 |
ソースコード
#define _USE_MATH_DEFINES
#include<cstdio>
#include <iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
using namespace std;
typedef long long ll;
typedef pair<int, int> Pr;
int n;
int ans;
int num;
int main()
{
cin >> n;
string s = to_string(n);
for (int i = 0; i < s.size(); i++) {
if (s[i] == '6' || s[i] == '4' || s[i] == '9' || s[i] == '0')
num++;
else if (s[i] == '8')
num+=2;
}
if (s.size() > 1)
ans = (num + 1) * 2 + s.size();
else{
ans = num + 1 + s.size();
if(num == 0)ans++;
}
cout << ans << endl;
return 0;
}