結果

問題 No.414 衝動
ユーザー kitayankitayan
提出日時 2016-10-14 15:33:18
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 688 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 16,768 KB
最終ジャッジ日時 2024-05-01 22:57:31
合計ジャッジ時間 4,600 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#! usr/bin/env python
# -*- coding:utf-8 -*-

if __name__ == "__main__":
    M = raw_input()
    M = int(M)

    ans1 = 1
    ans2 = M

    if M % 2 == 0:
        ans1 = str(M/2)
        print "2 " + ans1
        exit()
    elif M % 3 == 0:
        ans1 = str(M/3)
        print "3 " + ans1
        exit()
    elif M % 5 == 0:
        ans1 = str(M/5)
        print "5 " + ans1
        exit()
    elif M % 7 == 0:
        ans1 = str(M/7)
        print "7 " + ans1
        exit()
    else:
        for i in xrange(8, M/7, 2):
            if M % i == 0:
                ans1 = str(M/i)
                print str(i) + " " + ans1
                exit()

    print str(ans1) + " " + str(ans2)

0