結果

問題 No.509 塗りつぶしツール
ユーザー 0x19f
提出日時 2017-04-28 22:53:08
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 355 bytes
コンパイル時間 409 ms
コンパイル使用メモリ 56,196 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-13 18:25:37
合計ジャッジ時間 1,316 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#define REP(i, a, n) for(int i = (a); i < (n); i++)
using namespace std;

long table[10] = { 4, 3, 3, 3, 4, 3, 4, 3, 5, 4 };

int main(void) {
  string s; cin >> s;

  long ans = 0;
  REP(i, 0, s.length()) {
    ans += table[s[i] - '0'];
  }
  if(s.length() > 1) {
    ans -= s.length() - 1;
  }

  cout << ans << endl;

  return 0;
}
0