結果

問題 No.2415 偶数判定!Nafmoくん
コンテスト
ユーザー 2475057t
提出日時 2024-07-11 16:59:42
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 664 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 182 ms
コンパイル使用メモリ 37,312 KB
最終ジャッジ日時 2026-02-22 11:47:10
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
#include <stdlib.h>

int main(void){
    // 固定サイズの配列を使用
    char binarystring1[65];
    char binarystring2[65];

    // 標準入力からの文字列入力
    scanf("%64s", binarystring1); // 最大64文字の入力を受け付ける
    scanf("%64s", binarystring2);

    // 2進数文字列をlongに変換
    long num1 = strtol(binarystring1, NULL, 2);
    long num2 = strtol(binarystring2, NULL, 2);

    // num1とnum2の積を計算
    long N = num1 * num2;

    // 偶数か奇数かを判定して出力
    if(N % 2 == 0){
        printf("Even\n");
    } else {
        printf("Odd\n");
    }

    return 0;
}
0