結果

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

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 RE 0% 0ms 0KB
2 RE 0% 0ms 0KB
3 RE 0% 0ms 0KB
4 RE 0% 0ms 0KB
5 RE 0% 0ms 0KB
6 RE 0% 0ms 0KB
7 RE 0% 0ms 0KB
8 RE 0% 0ms 0KB
9 RE 0% 0ms 0KB
10 RE 0% 0ms 0KB
11 RE 0% 0ms 0KB
12 RE 0% 0ms 0KB
13 RE 0% 0ms 0KB
14 RE 0% 0ms 0KB
15 RE 0% 0ms 0KB
16 RE 0% 0ms 0KB
17 RE 0% 0ms 0KB
18 RE 0% 0ms 0KB
19 RE 0% 0ms 0KB
20 RE 0% 0ms 0KB
21 RE 0% 0ms 0KB
22 RE 0% 0ms 0KB
23 RE 0% 0ms 0KB
24 RE 0% 0ms 0KB
25 RE 0% 0ms 0KB
26 RE 0% 0ms 0KB
27 RE 0% 0ms 0KB
28 RE 0% 0ms 0KB
29 RE 0% 0ms 0KB
30 RE 0% 0ms 0KB

ソースコード

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;
	}
}