結果

問題 No.374 コイン
ユーザー uafr_csuafr_cs
提出日時 2017-11-06 20:53:58
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 781 bytes
コンパイル時間 2,194 ms
コンパイル使用メモリ 75,192 KB
実行使用メモリ 41,616 KB
最終ジャッジ日時 2024-05-03 06:22:41
合計ジャッジ時間 7,377 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
41,168 KB
testcase_01 AC 131 ms
41,096 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 130 ms
40,932 KB
testcase_08 AC 116 ms
40,080 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 127 ms
41,344 KB
testcase_12 AC 122 ms
40,504 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 119 ms
40,192 KB
testcase_18 AC 128 ms
41,076 KB
testcase_19 AC 123 ms
41,076 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 132 ms
41,416 KB
testcase_23 WA -
testcase_24 AC 128 ms
41,084 KB
testcase_25 AC 126 ms
41,284 KB
testcase_26 AC 135 ms
41,344 KB
testcase_27 AC 126 ms
41,256 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.TreeSet;

public class Main {
	
	// 円の中に円を詰める
	// https://en.wikipedia.org/wiki/Circle_packing_in_a_circle
	
	// 2個  -> A : B = 2 : 1
	// 3個  -> A : B = 2.154 : 1 => 3 : 1
	// 4個  -> A : B = 2.414 : 1 => 3 : 1
	// 6個  -> A : B = 3 : 1
	// 7個  -> A : B = 3 : 1
	// 8個  -> A : B = 4 : 1
	// 12個 -> A : B = 5 : 1
	// 20個 -> A : B = 6 : 1
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		final long A = sc.nextLong();
		final long B = sc.nextLong();
		
		if(A < B){ System.out.println("K"); return; }
		
		final long times = A / B;
		System.out.println(times % 2 == 0 ? "S" : "K");
	}
}
0