結果
| 問題 | No.308 素数は通れません |
| コンテスト | |
| ユーザー |
kuuso1
|
| 提出日時 | 2015-12-01 02:06:00 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,403 bytes |
| 記録 | |
| コンパイル時間 | 1,273 ms |
| コンパイル使用メモリ | 115,904 KB |
| 実行使用メモリ | 25,692 KB |
| 最終ジャッジ日時 | 2024-09-14 06:16:19 |
| 合計ジャッジ時間 | 5,863 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 98 WA * 9 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class TEST{
static void Main(){
Sol mySol =new Sol();
mySol.Solve();
}
}
class Sol{
public void Solve(){
N=0;
if(S.Length<4){
N=long.Parse(S);
}else{
N=long.Parse(S.Substring(S.Length-4));
}
int ans=0;
switch(N){
case 4: ans=3;break;
case 6: ans=5;break;
case 8: ans=7;break;
case 9: ans=7;break;
case 10: ans=7;break;
case 15: ans=7;break;
case 16: ans=7;break;
case 22: ans=7;break;
case 20: ans=19;break;
case 21: ans=19;break;
case 14: ans=13;break;
case 12: ans=11;break;
default:
if(N%8==1){
ans=14;
}else{
ans=8;
}break;
}
Console.WriteLine(ans);
}
String S;
long N;
public Sol(){
S=rs();
}
static String rs(){return Console.ReadLine();}
static int ri(){return int.Parse(Console.ReadLine());}
static long rl(){return long.Parse(Console.ReadLine());}
static double rd(){return double.Parse(Console.ReadLine());}
static String[] rsa(){return Console.ReadLine().Split(' ');}
static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}
kuuso1