結果

提出番号 1639
提出者 fal_rnd
言語 Java
提出日時 2018-08-04 13:19:37
問題名 (67)575ゲーム
結果 AC
点数 100%

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 AC 100% 89ms 100112KB
2 AC 100% 85ms 99360KB
3 AC 100% 76ms 100640KB
4 AC 100% 93ms 100112KB
5 AC 100% 90ms 98688KB
6 AC 100% 72ms 99824KB
7 AC 100% 67ms 99744KB
8 AC 100% 77ms 99952KB
9 AC 100% 78ms 100320KB
10 AC 100% 69ms 100096KB
11 AC 100% 85ms 99408KB
12 AC 100% 87ms 99408KB
13 AC 100% 79ms 98784KB
14 AC 100% 79ms 100384KB
15 AC 100% 70ms 100672KB
16 AC 100% 76ms 99648KB
17 AC 100% 80ms 99280KB
18 AC 100% 85ms 100656KB
19 AC 100% 81ms 100064KB
20 AC 100% 70ms 99792KB
21 AC 100% 69ms 100608KB
22 AC 100% 75ms 100320KB
23 AC 100% 87ms 98800KB
24 AC 100% 77ms 99712KB
25 AC 100% 80ms 100496KB
26 AC 100% 85ms 100064KB
27 AC 100% 68ms 100000KB
28 AC 100% 69ms 99168KB
29 AC 100% 88ms 98768KB
30 AC 100% 79ms 98736KB

ソースコード

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?"O":"K");
	}

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