結果
| 問題 |
No.1004 サイコロの実装 (2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-03-06 18:41:46 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 142 ms / 2,000 ms |
| コード長 | 458 bytes |
| コンパイル時間 | 2,450 ms |
| コンパイル使用メモリ | 76,776 KB |
| 実行使用メモリ | 41,752 KB |
| 最終ジャッジ日時 | 2024-10-14 02:59:42 |
| 合計ジャッジ時間 | 8,968 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 38 |
ソースコード
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
new Main().run();
}
void run() {
Scanner sc=new Scanner(System.in);
long a=sc.nextLong()%6;
long b=sc.nextLong()%6;
long x0=sc.nextLong()%6;
long N=sc.nextLong();
long x1=(a*x0+b)%6+1;
System.out.println(x1%2==0?(0+" "+N/2):(N/2+" "+0));
}
void tr(Object...objects) {System.out.println(Arrays.deepToString(objects));}
}