結果

問題 No.374 コイン
ユーザー uafr_csuafr_cs
提出日時 2017-11-06 21:01:46
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 791 bytes
コンパイル時間 2,003 ms
コンパイル使用メモリ 71,772 KB
実行使用メモリ 57,976 KB
最終ジャッジ日時 2023-08-15 19:38:35
合計ジャッジ時間 6,120 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
57,976 KB
testcase_01 AC 109 ms
56,032 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 105 ms
55,952 KB
testcase_08 AC 105 ms
56,076 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 110 ms
56,204 KB
testcase_12 AC 107 ms
56,096 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 108 ms
55,584 KB
testcase_18 AC 105 ms
56,164 KB
testcase_19 AC 107 ms
54,080 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 105 ms
53,956 KB
testcase_23 WA -
testcase_24 AC 106 ms
55,768 KB
testcase_25 AC 106 ms
55,476 KB
testcase_26 AC 104 ms
56,192 KB
testcase_27 AC 110 ms
56,292 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 * times) % 2 == 0 ? "S" : "K");
	}
}
0