結果
問題 |
No.509 塗りつぶしツール
|
ユーザー |
![]() |
提出日時 | 2025-06-21 00:36:11 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 759 bytes |
コンパイル時間 | 3,035 ms |
コンパイル使用メモリ | 275,824 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-06-21 00:36:16 |
合計ジャッジ時間 | 4,289 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); string n; cin >> n; array<int, 10> cnt = { 1, 0, 0, 0, 1, 0, 1, 0, 2, 1 }; int ans = 1e9; { int tmp = 0; tmp += n.size(); for (char c : n) tmp += cnt[c - '0']; tmp += 1; tmp += n.size(); ans = min(ans, tmp); } { int tmp = 0; tmp += 1; for (char c : n) tmp += cnt[c - '0']; tmp += n.size(); for (char c : n) tmp += cnt[c - '0']; tmp += 1; ans = min(ans, tmp); } cout << ans << '\n'; return 0; }