結果

問題 No.1462 最弱WEAKER
ユーザー Mister
提出日時 2021-05-01 01:45:44
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 541 ms
コンパイル使用メモリ 65,732 KB
最終ジャッジ日時 2025-01-21 04:57:59
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

void solve() {
    int n;
    cin >> n;

    int s = 0;
    while (n != 0) {
        s += n % 3;
        n /= 3;
    }

    cout << (s % 2 == 0 ? "YES" : "NO") << "\n";
}

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

    solve();

    return 0;
}
0