結果
問題 |
No.509 塗りつぶしツール
|
ユーザー |
![]() |
提出日時 | 2017-04-28 22:53:49 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 526 bytes |
コンパイル時間 | 527 ms |
コンパイル使用メモリ | 57,036 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-13 18:25:50 |
合計ジャッジ時間 | 1,443 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 5 WA * 22 |
ソースコード
#include <iostream> #include <string> int main(void){ using namespace std; int data[10] = {4, 3, 3, 3, 4, 3, 4, 3, 5, 3}; string str; cin >> str; int ans = 0; for(int i = 0; i < str.size(); ++i){ ans += data[str[i] - '0']; } ans -= str.size() - 1; ++ans; cout << ans << endl; return 0; } // 0, 4, 6, 9 -> 4 // 1, 2, 3, 5, 7 -> 3 // 8 -> // 数字を赤に // 背景を黒に // 上の穴を黒に // 下の穴を黒に // 数字を白に // よって、5回 // 1046928 // 3+4+4+4+4+3+5=7+8+7+5=15+12=27