結果

問題 No.308 素数は通れません
コンテスト
ユーザー 184
提出日時 2015-12-01 02:24:45
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 342 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 281 ms
コンパイル使用メモリ 40,320 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2026-04-04 10:50:09
合計ジャッジ時間 3,682 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 92 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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;
}
0