結果
問題 |
No.509 塗りつぶしツール
|
ユーザー |
|
提出日時 | 2020-04-15 21:42:27 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 417 bytes |
コンパイル時間 | 894 ms |
コンパイル使用メモリ | 72,036 KB |
最終ジャッジ日時 | 2025-01-09 19:19:45 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
#include <iostream> #include <vector> #include <string> const std::vector<int> num{1, 0, 0, 0, 1, 0, 1, 0, 2, 1}; void solve() { std::string s; std::cin >> s; int x = s.length(); int y = 1; for (char c : s) y += num[c - '0']; std::cout << std::min(x, y) + x + y << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }