Submission #1187500


Source Code Expand

# -*- coding: utf-8 -*-


def main():
    k, s = map(int, input().split())
    answer = solve(k, s)
    return answer


def solve(k, s):
    count = 0
    for i in range(k + 1):
        v = 0
        v += i
        if v == s:
            count += 1
            continue
        for j in range(k + 1):
            v += j
            if v == s:
                count += 1
                continue
            for k in range(k + 1):
                v += k
                if v == s:
                    count += 1
                    continue
    return count

print(main())

Submission Info

Submission Time
Task B - Sum of Three Integers
User tarunama
Language C++14 (GCC 5.4.1)
Score 0
Code Size 600 Byte
Status CE

Compile Error

./Main.cpp:1:3: error: invalid preprocessing directive #-
 # -*- coding: utf-8 -*-
   ^
./Main.cpp:4:1: error: ‘def’ does not name a type
 def main():
 ^