結果

問題 No.85 TVザッピング(1)
ユーザー holegumaholeguma
提出日時 2015-08-14 17:40:52
言語 Java21
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,553 bytes
コンパイル時間 2,960 ms
コンパイル使用メモリ 78,288 KB
実行使用メモリ 50,600 KB
最終ジャッジ日時 2024-04-15 05:19:41
合計ジャッジ時間 4,723 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
49,940 KB
testcase_01 AC 53 ms
50,384 KB
testcase_02 AC 53 ms
50,284 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 53 ms
50,484 KB
testcase_10 AC 52 ms
50,292 KB
testcase_11 AC 52 ms
50,432 KB
testcase_12 AC 53 ms
50,444 KB
testcase_13 AC 52 ms
50,416 KB
testcase_14 AC 52 ms
50,532 KB
testcase_15 AC 53 ms
50,100 KB
testcase_16 AC 52 ms
50,456 KB
testcase_17 AC 55 ms
49,920 KB
testcase_18 AC 53 ms
50,176 KB
testcase_19 AC 52 ms
50,332 KB
testcase_20 AC 53 ms
50,512 KB
testcase_21 AC 52 ms
50,516 KB
testcase_22 AC 54 ms
50,428 KB
testcase_23 AC 52 ms
50,056 KB
testcase_24 AC 53 ms
50,384 KB
testcase_25 AC 54 ms
50,540 KB
testcase_26 AC 53 ms
50,480 KB
testcase_27 AC 53 ms
50,036 KB
testcase_28 AC 53 ms
50,388 KB
testcase_29 AC 54 ms
50,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.StringTokenizer;


class Main{

static final PrintWriter out=new PrintWriter(System.out);
static final int INF=Integer.MAX_VALUE/2;
static int[] dx={-1,0,1,0};
static int[] dy={0,-1,0,1};

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
StringTokenizer st=new StringTokenizer(line);
int n=Integer.parseInt(st.nextToken());
int m=Integer.parseInt(st.nextToken());
if((n==1&&m==2)||(n==2&&m==1)) out.println("YES");
else if(n==1||m==1) out.println("NO");
else if(n%2==0||n%2==0) out.println("YES");
else out.println("NO");
out.flush();
}
}

static class Pair{
int x;
int y;
Pair(int x,int y){
this.x=x; this.y=y;
}
}

static class Edge{
int from;
int to;
int cost;
Edge(int from,int to,int cost){
this.from=from; this.to=to; this.cost=cost;
}
Edge(int to,int cost){
this.to=to; this.cost=cost;
}
}

static class Node{
int d;
int v;
Node(int d,int v){
this.d=d; this.v=v;
}
final static Comparator<Node> DISTANCE_ORDER=new DistanceOrderComparator();
static class DistanceOrderComparator implements Comparator<Node>{
public int compare(Node n1,Node n2){
return (n1.d>n2.d)?1:(n1.d<n2.d)?-1:0;
}
}
}
}
0