結果
問題 |
No.509 塗りつぶしツール
|
ユーザー |
![]() |
提出日時 | 2017-04-28 23:06:01 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 298 bytes |
コンパイル時間 | 275 ms |
コンパイル使用メモリ | 23,040 KB |
実行使用メモリ | 99,200 KB |
最終ジャッジ日時 | 2024-09-13 18:30:06 |
合計ジャッジ時間 | 3,380 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 WA * 16 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%s",a); | ~~~~~^~~~~~~~
ソースコード
#include<stdio.h> #include<string.h> int main(void) { char a[100000000]; int count=0; scanf("%s",a); int b=strlen(a); while(b>0){ if(a[b-1]=='4'||a[b-1]=='6'||a[b-1]=='9'||a[b-1]=='0') count+=1; else if(a[b-1]=='8') count+=2; count+=2; b--; } count++; printf("%d\n",count); }