結果
問題 |
No.509 塗りつぶしツール
|
ユーザー |
![]() |
提出日時 | 2017-05-18 02:06:40 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 388 bytes |
コンパイル時間 | 503 ms |
コンパイル使用メモリ | 65,768 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-17 21:07:23 |
合計ジャッジ時間 | 1,606 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
#include <cstdio> #include <cstring> #include <random> #include <vector> #include <algorithm> #include <array> using namespace std;; int main(){ int h[]={1,0,0,0,1,0,1,0,2,1},holes=0,a,b; char s[20]; int _=scanf("%s",s); for(int i=0;s[i];i++){ holes+=h[s[i]-'0']; } a=2*strlen(s)+holes+1; b=2*(holes+1)+strlen(s); //printf("%d %d\n",a,b); printf("%d\n",a>b?b:a); return 0; }