結果
| 問題 |
No.308 素数は通れません
|
| コンテスト | |
| ユーザー |
184
|
| 提出日時 | 2015-12-01 02:24:45 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 342 bytes |
| コンパイル時間 | 193 ms |
| コンパイル使用メモリ | 24,552 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-14 06:18:05 |
| 合計ジャッジ時間 | 2,502 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 92 WA * 15 |
コンパイルメッセージ
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 <cstdio>
#include <cstdlib>
#include <cstring>
int main(){
char s[31];
scanf("%s",s);
int len=strlen(s);
int n;
if(len>2){printf("8\n");return 0;}
else n=atoi(s);
int ans[10001]={};
ans[4]=3,ans[6]=5;
ans[8]=ans[9]=ans[10]=ans[15]=ans[16]=ans[22]=7;
ans[1000]=8;
if(!ans[n])n=1000;
printf("%d\n",ans[n]);
return 0;
}
184