結果
| 問題 |
No.509 塗りつぶしツール
|
| コンテスト | |
| ユーザー |
h8d51n
|
| 提出日時 | 2017-04-28 22:51:19 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 285 bytes |
| コンパイル時間 | 114 ms |
| コンパイル使用メモリ | 23,296 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-13 18:24:41 |
| 合計ジャッジ時間 | 999 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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",s);
| ~~~~~^~~~~~~~
ソースコード
#include<stdio.h>
#include<string.h>
int main(void){
char s[10];
int n;
int i;
int ans=1;
scanf("%s",s);
for(i=0;i<strlen(s);i++){
n=s[i]-'0';
if(n==1||n==2||n==3||n==5||n==7)ans+=2;
else if(n==0||n==4||n==6||n==9)ans+=3;
else ans+=4;
}
printf("%d\n",ans);
return 0;
}
h8d51n