結果

問題 No.308 素数は通れません
ユーザー oyasoyas
提出日時 2016-01-02 20:50:11
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 439 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 22,144 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-19 10:37:06
合計ジャッジ時間 2,803 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 95 WA * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%lld", &n);
      |         ~~~~~^~~~~~~~~~~~

ソースコード

diff #

#include <cstdio>

int main(){
	long long int n;
	int ans=0;
	scanf("%lld", &n);
	switch(n){
		case 4:
			ans = 3;
			break;
		case 6:
			ans = 5;
			break;
		case 8:
		case 9:
		case 10:
		case 15:
		case 16:
		case 22:
			ans = 7;
			break;
		case 18:
			ans = 8;
		case 12:
			ans = 11;
			break;
		case 14:
			ans = 13;
			break;
		case 20:
		case 21:
			ans = 19;
			break;
		default:
			ans = 8;
	}
	printf("%d\n", ans);
	return 0;
}
0