結果
| 問題 |
No.509 塗りつぶしツール
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-05-07 18:21:51 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 537 bytes |
| コンパイル時間 | 1,292 ms |
| コンパイル使用メモリ | 157,928 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 02:18:13 |
| 合計ジャッジ時間 | 2,192 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 WA * 16 |
ソースコード
#include "bits/stdc++.h"
#define fastcin {\
cin.tie(0);\
ios::sync_with_stdio(false);\
}
using namespace std;
int main() {
fastcin;
string n;
cin >> n;
long ans = 1;
for(long i = 0; i < n.length(); i++) {
if(n[i] == '0' || n[i] == '4' || n[i] == '6' || n[i] == '9') {
ans += 3;
} else if(n[i] == '1' || n[i] == '2' || n[i] == '3' || n[i] == '5' || n[i] == '7') {
ans += 2;
} else {
ans += 4;
}
}
cout << ans << '\n';
return 0;
}