結果

提出番号 1605
提出者 fal_rnd
言語 Java
提出日時 2018-08-04 13:15:22
問題名 (67)575ゲーム
結果 WA
点数 0%

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 AC 100% 78ms 100128KB
2 WA 0% 77ms 99536KB
3 AC 100% 68ms 100064KB
4 WA 0% 78ms 100000KB
5 AC 100% 75ms 100000KB
6 WA 0% 87ms 100864KB
7 WA 0% 74ms 98816KB
8 AC 100% 70ms 100032KB
9 WA 0% 80ms 99872KB
10 AC 100% 76ms 99280KB
11 WA 0% 71ms 99920KB
12 AC 100% 69ms 100576KB
13 AC 100% 84ms 99328KB
14 WA 0% 68ms 100144KB
15 WA 0% 81ms 99120KB
16 WA 0% 81ms 99696KB
17 AC 100% 69ms 99776KB
18 AC 100% 93ms 99344KB
19 AC 100% 76ms 99312KB
20 AC 100% 75ms 100096KB
21 WA 0% 82ms 99984KB
22 AC 100% 75ms 99392KB
23 AC 100% 75ms 99216KB
24 AC 100% 89ms 98560KB
25 AC 100% 73ms 100144KB
26 AC 100% 68ms 100112KB
27 AC 100% 79ms 100144KB
28 WA 0% 69ms 99632KB
29 AC 100% 75ms 99312KB
30 AC 100% 69ms 100032KB

ソースコード

import java.util.Iterator;
import java.util.PrimitiveIterator;
import java.util.Scanner;
import java.util.function.Supplier;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Main{
	static Scanner s=new Scanner(System.in);
	
	void solve(){
		int n=gInt(),m=gInt();
		int v=Math.min(n/4,m/2);
		n-=v*4;
		m-=v*2;
//		System.err.println(n+" "+m);
		System.out.println(n<2&&m<1?"K":"O");
	}

	public static void main(String[] A){
		new Main().solve();
	}

	static int gInt(){
		return Integer.parseInt(s.next());
	}
	static long gLong(){
		return Long.parseLong(s.next());
	}
	static double gDouble(){
		return Double.parseDouble(s.next());
	}

	SupplyingIterator<Integer> ints(int n){
		return new SupplyingIterator<>(n,Main::gInt);
	}
	SupplyingIterator<Long> longs(int n){
		return new SupplyingIterator<>(n,Main::gLong);
	}
	SupplyingIterator<Double> doubles(int n){
		return new SupplyingIterator<>(n,Main::gDouble);
	}
	SupplyingIterator<String> strs(int n){
		return new SupplyingIterator<>(n,s::next);
	}

	Range rep(int i){
		return new Range(i);
	}
	Range rep(int f,int t,int d){
		return new Range(f,t,d);
	}
	Range rep(int f,int t){
		return rep(f,t,1);
	}
	Range rrep(int f,int t){
		return rep(t,f,-1);
	}

	IntStream REP(int n){
		return REP(0,n-1);
	}
	IntStream REP(int l,int r){
		return IntStream.rangeClosed(l,r);
	}

	IntStream INTS(int n){
		return IntStream.generate(Main::gInt).limit(n);
	}
	Stream<String> STRS(int n){
		return Stream.generate(s::next).limit(n);
	}

}
class SupplyingIterator<T> implements Iterable<T>,Iterator<T>{
	int			t;
	Supplier<T>	supplier;

	SupplyingIterator(int t,Supplier<T> supplier){
		this.t=t;
		this.supplier=supplier;
	}

	@Override
	public Iterator<T> iterator(){
		return this;
	}

	@Override
	public boolean hasNext(){
		return t>0;
	}

	@Override
	public T next(){
		--t;
		return supplier.get();
	}
}

class Range implements Iterable<Integer>,PrimitiveIterator.OfInt{
	int to,cur,d;

	Range(int from,int to,int d){
		this.cur=from-d;
		this.to=to;
		this.d=d;
	}

	Range(int n){
		this(0,n-1,1);
	}

	@Override
	public Iterator<Integer> iterator(){
		return this;
	}

	@Override
	public boolean hasNext(){
		return cur+d==to||(cur!=to&&(cur<to==cur+d<to));
	}

	@Override
	public int nextInt(){
		return cur+=d;
	}
}