結果

問題 No.136 Yet Another GCD Problem
ユーザー izuru_matsuura
提出日時 2016-08-25 21:27:32
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 846 bytes
コンパイル時間 1,250 ms
コンパイル使用メモリ 157,140 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-08 02:24:04
合計ジャッジ時間 2,513 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 39
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

namespace {

    typedef double real;
    typedef long long ll;

    template<class T> ostream& operator<<(ostream& os, const vector<T>& vs) {
        if (vs.empty()) return os << "[]";
        os << "[" << vs[0];
        for (int i = 1; i < vs.size(); i++) os << " " << vs[i];
        return os << "]";
    }
    template<class T> istream& operator>>(istream& is, vector<T>& vs) {
        for (auto it = vs.begin(); it != vs.end(); it++) is >> *it;
        return is;
    }

    int N, K;
    void input() {
        cin >> N >> K;
    }

    void solve() {
        for (int n = 2; n <= N; n++) {
            if (N % n == 0) {
                cout << N / n << endl;
                return;
            }
        }
        assert(false);
    }
}

int main() {
    input(); solve();
    return 0;
}

0