0w1

Yuki 85 TVザッピング(1) ( Ad hoc )

No.85 TVザッピング(1) - yukicoder
証明が面白い。チェスをイメージしましょう。
kmjp.hatenablog.jp

#include <bits/stdc++.h>
using namespace std;

const string msg[] = { "NO", "YES" };

signed main(){
  int N, M, C; cin >> N >> M >> C;
  if( not ( N >= M ) )
    swap( N, M );
  if( M == 1 )
    cout << msg[ N == 2 ] << endl, exit( 0 );
  if( N % 2 == 0 or M % 2 == 0 )
    cout << msg[ 1 ] << endl;
  else
    cout << msg[ 0 ] << endl;
  return 0;
}