結果

問題 No.276 連続する整数の和(1)
ユーザー togatoga
提出日時 2015-09-05 11:28:59
言語 Python2
(2.7.18)
結果
AC  
実行時間 11 ms / 1,000 ms
コード長 573 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2024-07-19 03:48:18
合計ジャッジ時間 784 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
N = input()
if (N % 2 == 0):
    print N / 2
else:
    print N
sys.exit()    
for i in range(1, 100):
    a = 1
    t1 = 0
    deg = [0] * 10000
    for x in range(i):
        t1 += a
        a += 1
    for x in range(1, t1 / 2 + 1):
        if (t1 % x == 0):
            deg[x] += 1
    a = 2
    t2 = 0
    for x in range(i):
        t2 += a
        a += 1
    for x in range(1, t2 / 2 + 1):
        if (t2 % x == 0):
            deg[x] += 1
    res = 0
    for index,x in enumerate(deg):
        if (x >= 2):
            res = max(res, index)
    print i,res
0