結果
| 問題 | No.415 ぴょん |
| コンテスト | |
| ユーザー |
fjafjafja
|
| 提出日時 | 2017-09-03 16:01:45 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 512 bytes |
| 記録 | |
| コンパイル時間 | 3,658 ms |
| コンパイル使用メモリ | 83,636 KB |
| 実行使用メモリ | 126,628 KB |
| 最終ジャッジ日時 | 2026-05-07 01:22:47 |
| 合計ジャッジ時間 | 7,766 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 RE * 10 |
ソースコード
package yukicoder;
import java.util.Scanner;
public class N415
{
static int N=0;
static int D=0;
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
N=sc.nextInt();
D=sc.nextInt();
int[] fl=new int[N];
int pyon=0;
int now=0;
fl[0]=1;
for(int i=1;i<N;i++)
{
fl[i]=0;
}
now=next(now);
while(fl[now]==0)
{
pyon++;
fl[now]=1;
now=next(now);
}
System.out.println(pyon);
}
static int next(int now)
{
return (now+D>N-1)?now+D-N:now+D;
}
}
fjafjafja