結果

問題 No.3043 yukicoderへようこそ!
ユーザー fumiphysfumiphys
提出日時 2019-04-02 00:01:14
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 20 ms / 2,000 ms
コード長 1,351 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 11,004 KB
実行使用メモリ 9,016 KB
最終ジャッジ日時 2023-08-18 03:44:04
合計ジャッジ時間 726 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,820 KB
testcase_01 AC 20 ms
8,996 KB
testcase_02 AC 19 ms
8,880 KB
testcase_03 AC 18 ms
8,984 KB
testcase_04 AC 18 ms
8,808 KB
testcase_05 AC 19 ms
9,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import random
if __name__ == '__main__':
    line = input()
    b = 0
    if len(line.split(" ")) > 1:
        try:
            li = int(line[0])
            a, b = list(map(int, line.strip().split(" ")))
            res = a + b
            line = input()
            print("{} {}".format(res, line))
            b = 1
        except:
            pass
    if b == 1:
        sys.exit()
    try:
        line = int(line)
    except Exception as e:
        print("Hello World!")
        sys.exit()

    try:
        L = input()
    except Exception as e:
        if random.random() < 0.5:
            res = int(line * (line + 1) / 2)
            print(res)
        else:
            for i in range(1, line+1):
                res = ""
                if i % 3 == 0:
                    res += "Fizz"
                if i % 5 == 0:
                    res += "Buzz"
                if i % 3 != 0 and i % 5 != 0:
                    res = str(i)
                print(res)
        sys.exit()

    if len(L.split(" ")) > 1:
        val = list(map(int, L.strip().split(" ")))
        sum = 0
        for v in val:
            sum += v
        print(sum)
        sys.exit()
    else:
        sum = 0
        sum += int(L)
        for i in range(0, line - 1):
            a = int(input())
            sum += a
        print(sum)
        sys.exit()
0