結果

問題 No.509 塗りつぶしツール
ユーザー suwaharu
提出日時 2017-04-28 23:02:43
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
MLE  
実行時間 -
コード長 299 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 23,040 KB
実行使用メモリ 812,672 KB
最終ジャッジ日時 2024-09-13 18:28:51
合計ジャッジ時間 3,330 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample MLE * 1 -- * 2
other -- * 27
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);
      |         ~~~~~^~~~~~~~

ソースコード

diff #

#include<stdio.h>
#include<string.h>

int main(void)
{
	char a[1000000000];
	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);
}
0