結果

問題 No.374 コイン
ユーザー uafr_cs
提出日時 2017-11-06 21:01:46
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 791 bytes
コンパイル時間 2,212 ms
コンパイル使用メモリ 75,808 KB
実行使用メモリ 41,568 KB
最終ジャッジ日時 2024-11-24 04:06:26
合計ジャッジ時間 6,291 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 17
権限があれば一括ダウンロードができます

ソースコード

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