結果

問題 No.8029 素因数
ユーザー merom686
提出日時 2017-09-23 13:17:03
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 250 ms
コード長 435 bytes
コンパイル時間 765 ms
コンパイル使用メモリ 73,680 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-14 04:10:28
合計ジャッジ時間 2,028 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <math.h>
using namespace std;

int main() {
    int m;
    cin >> m;

    char c[] = "177635683940025046467781066894531";
    int n = strlen(c);

    int r = 0;
    for (int i = 0; i < n; i++) {
        r = (r * 10 + (c[i] - '0')) % m;
    }

    cout << (r % 2 == 0 ? "even" : "odd") << endl;

    return 0;
}
0