結果

問題 No.85 TVザッピング(1)
ユーザー kichirb3
提出日時 2018-03-19 00:54:27
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 503 bytes
コンパイル時間 715 ms
コンパイル使用メモリ 64,128 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-30 15:04:13
合計ジャッジ時間 1,815 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

// No.85 TVザッピング(1)
// https://yukicoder.me/problems/no/85
//
#include <iostream>
#include <string>
using namespace std;

string solve(int N, int M);


int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    int N, M, C;
    cin >> N >> M >> C;
    string ans = solve(N, M);
    cout << ans << endl;
}

string solve(int N, int M) {
    if ((N % 2 == 1 && M % 2 == 1) || (N == 1 && M != 2) || (M == 1 && N != 2))
        return "NO";
    else
        return "YES";
}
0