結果
問題 |
No.509 塗りつぶしツール
|
ユーザー |
![]() |
提出日時 | 2017-04-28 22:46:34 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 404 bytes |
コンパイル時間 | 1,280 ms |
コンパイル使用メモリ | 64,380 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 18:13:23 |
合計ジャッジ時間 | 1,813 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <cmath> using namespace std; int num1[] = { 3,2,2,2,3,2,3,2,4,3}; int num2[] = { 3,1,1,1,3,1,3,1,5,3 }; int main() { string n; cin >> n; int ans1 = 1; int ans2 = 2; for (int i = 0; i < n.size(); i++) { ans1 += num1[n[i]-'0']; ans2 += num2[n[i] - '0']; } cout << min(ans1,ans2) << endl; return 0; }