output_description stringlengths 15 956 | submission_id stringlengths 10 10 | status stringclasses 3 values | problem_id stringlengths 6 6 | input_description stringlengths 9 2.55k | attempt stringlengths 1 13.7k | problem_description stringlengths 7 5.24k | samples stringlengths 2 2.72k |
|---|---|---|---|---|---|---|---|
Print the hour of the starting time of the contest in 24-hour time.
* * * | s128717697 | Accepted | p03773 | The input is given from Standard Input in the following format:
A B | x = input().split()
ans = int(x[0]) + int(x[1])
print(int(ans % 24))
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s842574277 | Wrong Answer | p03773 | The input is given from Standard Input in the following format:
A B | a = sum([int(x) for x in input().split()])
while a < 24:
a -= 24
print(a)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s295996465 | Wrong Answer | p03773 | The input is given from Standard Input in the following format:
A B | def R_T(a, b):
time_ = a + b
if time_ > 24:
return time_ - 24
else:
return time_
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s175993746 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | fn main() {
let a: i32 = read();
let b: i32 = read();
let ans = (a+b) % 24;
println!("{}", ans);
}
// 以下関数
use std::io::*;
use std::str::FromStr;
pub fn read<T: FromStr>() -> T {
let stdin = stdin();
let stdin = stdin.lock();
let token: String = stdin
.bytes()
.map(|c| c.expect("failed to read char") as char)
.skip_while(|c| c.is_whitespace())
.take_while(|c| !c.is_whitespace())
.collect();
token.parse().ok().expect("failed to parse token")
}
pub const MOD: u64 = 10e9 as u64 + 7;
pub fn is_prime(n: i32) -> bool {
if n < 2 {
return false;
} else if n == 2 {
return true;
}
let mut i = 2;
while i * i < n {
if n % i == 0 {
return false;
} else {
i += 1;
continue;
}
}
true
}
pub fn lcm(mut n: i32, mut m: i32) -> i32 {
n = if n > m { m } else { n };
m = if n > m { n } else { m };
let mut i = n;
while i % m != 0 {
i += n;
}
i
}
pub fn abs(n: i32) -> i32 {
if n >= 0 {
n
} else {
-n
}
}
pub fn max(n: i32, m: i32) -> i32 {
if n >= m {
n
} else {
m
}
}
pub fn min(n: i32, m: i32) -> i32 {
if n <= m {
n
} else {
m
}
} | Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s970647201 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | import sys
import math
import bisect
def main():
a, b = map(int, input().split())
ans = a + b
while (ans > 24)
ans -= 24
print(ans)
if __name__ == "__main__":
main()
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s928984402 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | A,B = [for(i) for i in input().split()]
if A + B > 24:
print(A + B -24)
else:
print(A+B) | Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s639369800 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | import sys
sys.setrecursionlimit(10000)
def memoize(f):
cache = {}
def func(*args):
if args not in cache:
cache[args] = f(*args)
return cache[args]
return func
@memoize
def combi(n, r):
if r == 0 or n == r:
return 1
return combi(n - 1, r - 1) + combi(n - 1, r)
n, a, b = map(int, input().split())
items = sorted(map(int, input().split()), reverse=True)
max_ave_list = items[:a]
print(sum(max_ave_list) / len(max_ave_list))
m = max_ave_list.count(max_ave_list[-1])
l = items.count(max_ave_list[-1])
if l == m:
print(1)
elif max_ave_list[0] != max_ave_list[-1]:
print(combi(l, m))
else:
print(sum(combi(l, k) for k in range(m, min(b, l) + 1)))
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s249394786 | Accepted | p03773 | The input is given from Standard Input in the following format:
A B | n, m = map(int, input().split())
print((n + m) % 24)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s058863408 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | A B = map(int, input().split())
print((A+B)%24)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s955622971 | Wrong Answer | p03773 | The input is given from Standard Input in the following format:
A B | print(sum(list(map(int, input().split()))) // 24)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s564294827 | Wrong Answer | p03773 | The input is given from Standard Input in the following format:
A B | print(eval(input().replace(" ", "+") + "%24"))
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s092626980 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | A B = map(int, input().split())
print((A+B)%24) | Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s931080768 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | (t if t < 24 else t - 24)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s250507258 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | A, B = map(int,input(.split()))
print((A+B)%24) | Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s284989906 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | print(A + B / 24)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s270739387 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | A
B
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s962089630 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | a,b=map(int,input().split())
print(a+b%24) | Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s646140102 | Accepted | p03773 | The input is given from Standard Input in the following format:
A B | h, dh = map(int, input().split())
print((h + dh) % 24)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s992692761 | Wrong Answer | p03773 | The input is given from Standard Input in the following format:
A B | a = sum(map(int, input().split()))
print(a if a <= 24 else a - 24)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s046766143 | Wrong Answer | p03773 | The input is given from Standard Input in the following format:
A B | data = input().split()
print(int(data[0]) + int(data[1]))
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s315518269 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | a, b = map(int, input().split(" ");
print( (a+b) % 24) | Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s332347255 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | A = 20
B = 6
X = A + B
if(X>= 24):
X = X - 24
print(X)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s016225519 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | print((lambda a, b: (a + b) // 24)(list(map(int, input().split()))))
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s310695120 | Accepted | p03773 | The input is given from Standard Input in the following format:
A B | num = list(map(int, input().split()))
a = num[0] + num[1]
print(int(a % 24))
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s215895087 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | a,b=map(int,input().split())
if a+b < 24:
print(a+b)
else : print(24-a-b) | Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s365846183 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | a, b = map(int, input().split())
ans=a+b
if ans>=24:
ans=ans-24
print(ans) | Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s822340757 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | a,b = map(int,input().split())
c = a+b
if(c>=24):
print(c-24):
else:
print(c)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s567528935 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B |
a, b = map(int, input().split())
if A+B=>24:
print(A+B-24)
else:
print(A+B) | Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s662580010 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | A, B = map(int, input().split())
print(A+B -24*((A+B)//24) if A+B > =24 else A+B) | Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s894895509 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | def ncr(x, y):
ans = 1
q = x - y
while x > y:
ans *= x
x = x - 1
while q > 1:
ans = ans / q
q = q - 1
return ans
x = input().split()
n = int(x[0])
a = int(x[1])
b = int(x[2])
v = [0] * n
x = input().split()
ind = 0
M = {1: 0}
M2 = {1: 0}
for i in x:
v[ind] = int(i)
if int(i) in M:
M[v[ind]] += 1
else:
M[v[ind]] = 1
ind += 1
v.sort(reverse=True)
cnt = 0
ind = 0
m = 0
while cnt < a:
cnt += 1
m = ((cnt - 1) * m + v[ind]) / cnt
if v[ind] in M2:
M2[v[ind]] += 1
else:
M2[v[ind]] = 1
ind += 1
while cnt < b:
if (cnt * m + v[ind]) / (cnt + 1) < m - 0.5:
break
else:
cnt += 1
if v[ind] in M2:
M2[v[ind]] += 1
else:
M2[v[ind]] = 1
ind += 1
print(m)
maxw = cnt
ways = 0
for i in range(cnt, a - 1, -1):
if v[ind - 1] not in M2:
M2[v[ind]] = 0
if v[ind - 1] not in M:
M[v[ind - 1]] = 0
ways += ncr(M[v[ind - 1]], M2[v[ind - 1]])
M2[v[ind - 1]] -= 1
print(int(ways))
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s516786371 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | a, b = map(int, input().split())
if a + b≧24:
print(a + b - 24)
else:
print(a + b)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s567142630 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | #ABC057.B
N,M = map(int(input().split()))
L1 = []
L2 = []
for i in range(N):
a,b = map(int,input().split())
L1.append([a,b])
for m in range(M):
c,d = map(int,input().split())
L2.append([c,d])
for j in range(N):
L3 = []
for l in range(M):
L3.append(abs(L1[j][0]-L2[l][0]) + abs(L1[j][1]-L2[l][1]))
print(L3.index(min(L3)+1) | Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s931810459 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | N, M = map(int, input().split())
student = [list(map(int, input().split())) for _ in range(N)]
cp = [list(map(int, input().split())) for _ in range(M)]
idou = []
for a, b in student:
idousaki = -1
nearest = 1000000000
for i, x, y in enumerate(cp):
d = abs(x - a) + abs(y - b)
if d < nearest:
nearest = d
idousaki = i + 1
idou.append(idousaki)
for i in idou:
print(i)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s419427709 | Wrong Answer | p03773 | The input is given from Standard Input in the following format:
A B | A, B = map(int, input().split())
AB = A + B
if B == 0:
print(A)
elif AB <= 24:
print(AB)
else:
print(AB - 24)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s082141554 | Wrong Answer | p03773 | The input is given from Standard Input in the following format:
A B | print(eval(input().replace(" ", "+")) % 12)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s977070933 | Accepted | p03773 | The input is given from Standard Input in the following format:
A B | A = list(map(int, input().split(" ")))
print(sum(A) % 24)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s515272859 | Accepted | p03266 | Input is given from Standard Input in the following format:
N K | a, b = map(int, input().split())
c = []
d = []
for i in range(1, a + 1):
if i % b == 0:
c.append(i)
elif i % b == b / 2:
d.append(i)
e = 0
print(len(c) * len(c) * len(c) + len(d) * len(d) * len(d))
| Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s139659473 | Wrong Answer | p03266 | Input is given from Standard Input in the following format:
N K | N, K = map(int, input().split())
same = 0
bonus = 0
for i in range(K, N * 2 + 1, K):
if i % 2 == 0:
same += 1
if same % 2 == 0:
for i in range(same - 3, 0, -2):
bonus += 6 * i
else:
cof = 0
for i in range(same - 2, 0, -2):
cof += 1
bonus += 6 * cof * i
print(same + bonus)
| Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s338940354 | Wrong Answer | p03266 | Input is given from Standard Input in the following format:
N K | n, k = list(map(int, input().split()))
q, m = divmod(n, k)
a = 0
b = 0
for i in range(1, k + 1):
if (i * 2) % k != 0:
a_ = 0
else:
a_ = q + 1 if i <= m else q
a_ *= a_
a += a_
if i == k - m and m != 0:
b = a
print(a * q + b)
| Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s111784892 | Accepted | p03266 | Input is given from Standard Input in the following format:
N K | a, b = map(int, input().split())
ans = 0
if b % 2 == 0:
half = b // 2
ex_half = a - half
# print(ex_half)
n_half = ex_half // b + 1
# print(n_half)
ans = ans + n_half
if n_half >= 2:
ans = ans + 3 * n_half * (n_half - 1)
if n_half >= 3:
ans = ans + 6 * n_half * (n_half - 1) * (n_half - 2) // 6
else:
pass
n_baisuu = a // b
# print(n_baisuu)
ans = ans + n_baisuu
if n_baisuu >= 2:
ans = ans + 3 * n_baisuu * (n_baisuu - 1) // 2 * 2
if n_baisuu >= 3:
ans = ans + 6 * n_baisuu * (n_baisuu - 1) * (n_baisuu - 2) // 6
print(ans)
| Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s016701363 | Accepted | p03266 | Input is given from Standard Input in the following format:
N K | ###############################################################################
from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
mod = 1
def intin():
input_tuple = input().split()
if len(input_tuple) <= 1:
return int(input_tuple[0])
return tuple(map(int, input_tuple))
def intina():
return [int(i) for i in input().split()]
def intinl(count):
return [intin() for _ in range(count)]
def modadd(x, y):
global mod
return (x + y) % mod
def modmlt(x, y):
global mod
return (x * y) % mod
def lcm(x, y):
while y != 0:
z = x % y
x = y
y = z
return x
def combination(x, y):
assert x >= y
if y > x // 2:
y = x - y
ret = 1
for i in range(0, y):
j = x - i
i = i + 1
ret = ret * j
ret = ret // i
return ret
def get_divisors(x):
retlist = []
for i in range(1, int(x**0.5) + 3):
if x % i == 0:
retlist.append(i)
retlist.append(x // i)
return retlist
def get_factors(x):
retlist = []
for i in range(2, int(x**0.5) + 3):
while x % i == 0:
retlist.append(i)
x = x // i
retlist.append(x)
return retlist
def make_linklist(xylist):
linklist = {}
for a, b in xylist:
linklist.setdefault(a, [])
linklist.setdefault(b, [])
linklist[a].append(b)
linklist[b].append(a)
return linklist
def calc_longest_distance(linklist, v=1):
distance_list = {}
distance_count = 0
distance = 0
vlist_previous = []
vlist = [v]
nodecount = len(linklist)
while distance_count < nodecount:
vlist_next = []
for v in vlist:
distance_list[v] = distance
distance_count += 1
vlist_next.extend(linklist[v])
distance += 1
vlist_to_del = vlist_previous
vlist_previous = vlist
vlist = list(set(vlist_next) - set(vlist_to_del))
max_distance = -1
max_v = None
for v, distance in distance_list.items():
if distance > max_distance:
max_distance = distance
max_v = v
return (max_distance, max_v)
def calc_tree_diameter(linklist, v=1):
_, u = calc_longest_distance(linklist, v)
distance, _ = calc_longest_distance(linklist, u)
return distance
###############################################################################
def main():
n, k = intin()
ans = (n // k) ** 3
if k & 1:
print(ans)
return
ans += ((n + k // 2) // k) ** 3
print(ans)
if __name__ == "__main__":
main()
| Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s625496710 | Runtime Error | p03266 | Input is given from Standard Input in the following format:
N K | N,K=map(int,input().split())
num=[0]*(max(N+1,K)
for i in range(1,N+1):
num[i%K]+=1
#print(num)
ans=0
for a in range(K):
b=(K-a)%K#a=0なら0 a!=0ならk-aになる賢い手
c=(K-a)%K
if (b+c)%K!=0:
continue
else:
#print(a)
ans+=num[a]*num[b]*num[c]
#print(a,b,c)
print(ans) | Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s579636360 | Runtime Error | p03266 | Input is given from Standard Input in the following format:
N K | %%test_input https://abc108.contest.atcoder.jp/tasks/abc108_c
N, K = map(int, input().split())
ans = sum(((N + a % K) // K)**2 for a in range(1, N + 1) if (2 * a) % K == 0)
print(ans) | Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s863465038 | Wrong Answer | p03266 | Input is given from Standard Input in the following format:
N K | N, K = list(input().split())
c1 = 0
for a, b, c in range(int(N), int(N), int(N)):
if (a + b) % int(K) == 0 and (b + c) % int(K) == 0 and (c + a) % int(K) == 0:
c1 += 1
print(c1)
| Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s401890158 | Runtime Error | p03266 | Input is given from Standard Input in the following format:
N K | N, K = map(int, input().split())
if K % 2:
print(pow(int(N / K), 3)
else:
even = int(N / K)
odd = int(N / int(K / 2)) - even
print(even, odd)
print(pow(even, 3) + pow(odd, 3)) | Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s502971317 | Accepted | p03266 | Input is given from Standard Input in the following format:
N K | a, b = map(int, input().split())
if b % 2 == 1:
print((a // b) ** 3)
else:
c = (a - b / 2) // b + 1
print(int((a // b) ** 3 + c**3))
| Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s069709066 | Runtime Error | p03266 | Input is given from Standard Input in the following format:
N K | n,k=map(int,input().split())
o=n//k
p=0
if (k%2==0) p=(n+(k//2))//k
print(o**3+p**3)
| Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s256596272 | Runtime Error | p03266 | Input is given from Standard Input in the following format:
N K | gsg
| Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s405673956 | Wrong Answer | p03266 | Input is given from Standard Input in the following format:
N K | print(0)
| Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s624322029 | Runtime Error | p03266 | Input is given from Standard Input in the following format:
N K | 31415 9265 | Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s009146008 | Runtime Error | p03266 | Input is given from Standard Input in the following format:
N K | def is calc(N, K):
count = 0
for a in range(1, N):
for b in range(1, N):
c = N - a - b
if c > 0:
if a + b % N == 0 and b + c % N == 0 and a + c % N == 0:
count += 1
return count
if __name__ == '__main__':
N, K = map(int, input().split())
print(calc(N, K)) | Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s358866107 | Runtime Error | p03266 | Input is given from Standard Input in the following format:
N K | n, k = map(int, input().split())
mod0 = []
mod2 = []
for i in range(1, n + 1):
if i % k == 0:d i % k == k // 2:
mod2.append(i)
print(len(mod0) * len(mod0) * len(mod0) + len(mod2) * len(mod2) * len(mod2))
| Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s326129198 | Wrong Answer | p03266 | Input is given from Standard Input in the following format:
N K | # 108c
import math
N, K = map(int, input().split())
# a+b,b+c,c+a がすべて K の倍数
# TLEする。
# ans = 0
#
# for a in range(1,N+1):
# if K>a:
# base = K-a
# else:
# base = K*int(1+a/K)-a
#
# b_list = [base+i*K for i in range(0,1+math.floor((N-base)/K))]
#
# for b in b_list:
# if K > b:
# base = K-b
# else:
# base = K*int(1+b/K)-b
#
# c_list = [base+i*K for i in range(0,1+math.floor((N-base)/K))]
#
# for c in c_list:
# if (a+c)%K == 0:
# ans += 1
# print(a,b,c,":",a/K,b/K,c/K)
#
# print(ans)
# 上ので試してみた結果
# …K%2 = 0なら a,b,cは全てが K/2の奇数の倍数(1,3,5...) or Kの整数倍
# ex
# 31415 9266
# 4633 4633 4633 : 0.5 0.5 0.5
# 4633 4633 13899 : 0.5 0.5 1.5
# 9266 9266 9266 : 1.0 1.0 1.0
# 9266 9266 18532 : 1.0 1.0 2.0
# 9266 9266 27798 : 1.0 1.0 3.0
# …K%2 = 1なら Kの整数倍
if K == 1:
# すべてのa,b,cがOK
print(N * N * N)
elif K % 2 == 0:
# K/2の奇数の倍数(1,3,5...) と Kの整数倍
print([int(i * K / 2) for i in range(1, 1 + 2 * math.floor(N / K)) if i % 2 == 1])
ans = (
len([int(i * K / 2) for i in range(1, 1 + 2 * math.floor(N / K)) if i % 2 == 1])
** 3
)
print([i * K for i in range(1, 1 + math.floor(N / K))])
ans += math.floor(N / K) ** 3
print(ans)
elif K % 2 == 1:
print([i * K for i in range(1, 1 + math.floor(N / K))])
print((math.floor(N / K) ** 3))
| Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s978143208 | Wrong Answer | p03266 | Input is given from Standard Input in the following format:
N K | # coding: utf-8
# Your code here!
import copy
N, K = map(int, input().split())
lis = []
lis2 = []
lis3 = []
ans = 0
cnt = 0
m = 0
for i in range(1, N + 1):
now = i
count = N - i + 1
while count != 0:
if (i + now) % K == 0:
lis.append([i, now])
now += 1
count = count - 1
print(lis)
for j in range(len(lis)):
for k in range(1, N + 1):
if (lis[j][0] + k) % K == 0 and (lis[j][1] + k) % K == 0:
lis2.append(copy.copy(lis[j]))
lis2[cnt].append(k)
cnt += 1
print(lis2)
for l in range(len(lis2)):
lis3.append([lis2[l][0], lis2[l][1], lis2[l][2]])
lis3.append([lis2[l][0], lis2[l][2], lis2[l][1]])
lis3.append([lis2[l][1], lis2[l][0], lis2[l][2]])
lis3.append([lis2[l][1], lis2[l][2], lis2[l][0]])
lis3.append([lis2[l][2], lis2[l][0], lis2[l][1]])
lis3.append([lis2[l][2], lis2[l][1], lis2[l][0]])
def get_unique_list(seq):
seen = []
return [x for x in seq if x not in seen and not seen.append(x)]
print(lis3)
l_2d_unique = get_unique_list(lis3)
print(len(l_2d_unique))
| Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s867397765 | Wrong Answer | p03266 | Input is given from Standard Input in the following format:
N K | import math
s = input().split()
N = int(s[0])
K = int(s[1])
ct = 0
u = math.ceil(2 * N / K)
def cond_e(a, b, c):
if (
a + b - c > 0
and a - b + c > 0
and -a + b + c > 0
and a + b - c <= 2 * N / K
and a - b + c <= 2 * N / K
and -a + b + c <= 2 * N / K
):
return True
else:
return False
def cond_o(a, b, c):
if (
a + b - c > 0
and a - b + c > 0
and -a + b + c > 0
and a + b - c <= 2 * N / K
and a - b + c <= 2 * N / K
and -a + b + c <= 2 * N / K
and (a + b - c) % 2 == 0
and (a - b + c) % 2 == 0
and (-a + b + c) % 2 == 0
):
return True
else:
return False
print(u)
for a in range(1, u + 1):
for b in range(1, u + 1):
for c in range(1, u + 1):
if K % 2 == 0 and cond_e(a, b, c):
ct += 1
elif K % 2 != 0 and cond_o(a, b, c):
ct += 1
print(str(ct))
| Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s089052709 | Wrong Answer | p03266 | Input is given from Standard Input in the following format:
N K | l = input().split()
l[0] = int(l[0])
l[1] = int(l[1])
c1 = 0
c2 = 0
c3 = 0
for i in range(1, l[0] + 1):
for j in range(1, i + 1):
for k in range(1, j + 1):
if i + j % l[1] == 0 and i + k % l[1] == 0 and j + k % l[1] == 0:
if i == j == k:
c1 = c1 + 1
elif i == j > k or i > j == k:
c2 = c2 + 1
else:
c3 = c3 + 1
print(c1 + c2 * 3 + c3 * 6)
| Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the number of triples (a,b,c) of positive integers not greater than N
such that a+b,b+c and c+a are all multiples of K.
* * * | s084708712 | Wrong Answer | p03266 | Input is given from Standard Input in the following format:
N K | n, K = map(int, input().split())
c = 0
for i in range(1, n + 1):
for j in range(K - 2, n + 1):
for k in range(K - 2, n + 1):
if (i + j) % K == 0 and (j + k) % K == 0 and (k + i) % K == 0:
c += 1
print(c)
| Statement
You are given integers N and K. Find the number of triples (a,b,c) of positive
integers not greater than N such that a+b,b+c and c+a are all multiples of K.
The order of a,b,c does matter, and some of them can be the same. | [{"input": "3 2", "output": "9\n \n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3)\nsatisfy the condition.\n\n* * *"}, {"input": "5 3", "output": "1\n \n\n* * *"}, {"input": "31415 9265", "output": "27\n \n\n* * *"}, {"input": "35897 932", "output": "114191"}] |
Print the maximum possible value of M_1 + M_2 + \cdots + M_N.
* * * | s640915090 | Wrong Answer | p02924 | Input is given from Standard Input in the following format:
N | N = int(input())
if N < 10**6:
ans = 0
for i in range(1, N):
ans += i
elif (N >= 10**6) and (N < 10**7):
base = 0
_ = int(N / 10)
for i in range(_):
base += i
base_str = str(base)
base_str = base_str[:1] + base_str[1] + base_str[1:] + "0"
ans = int(base_str)
elif (N >= 10**7) and (N < 10**8):
base = 0
_ = int(N / 100)
for i in range(_):
base += i
base_str = str(base)
base_str = base_str[:1] + base_str[1] * 2 + base_str[1:] + "0" * 2
ans = int(base_str)
elif (N >= 10**8) and (N < 10**9):
base = 0
_ = int(N / 1000)
for i in range(_):
base += i
base_str = str(base)
base_str = base_str[:1] + base_str[1] * 3 + base_str[1:] + "0" * 3
ans = int(base_str)
else:
ans = 499999999500000000
print(ans)
| Statement
For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of
\\{1, 2, ..., N\\}.
Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.
Find the maximum possible value of M_1 + M_2 + \cdots + M_N. | [{"input": "2", "output": "1\n \n\nWhen the permutation \\\\{P_1, P_2\\\\} = \\\\{2, 1\\\\} is chosen, M_1 + M_2 = 1 + 0\n= 1.\n\n* * *"}, {"input": "13", "output": "78\n \n\n* * *"}, {"input": "1", "output": "0"}] |
Print the maximum possible value of M_1 + M_2 + \cdots + M_N.
* * * | s822742452 | Runtime Error | p02924 | Input is given from Standard Input in the following format:
N | N = int(input())
max = 0
init = list(range(1, N + 1))
all = []
hashtable = {}
tempSum = 0
def helper(input):
global tempSum, max
if len(input) == N:
# print(input)
if tempSum > max:
max = tempSum
return
for i in range(1, N + 1):
if i not in input:
input.append(i)
tempSum += len(input) % i
# print(tempSum, len(input), i)
helper(input)
input.pop()
tempSum -= len(input) % i
list = []
helper(list)
print(max)
| Statement
For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of
\\{1, 2, ..., N\\}.
Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.
Find the maximum possible value of M_1 + M_2 + \cdots + M_N. | [{"input": "2", "output": "1\n \n\nWhen the permutation \\\\{P_1, P_2\\\\} = \\\\{2, 1\\\\} is chosen, M_1 + M_2 = 1 + 0\n= 1.\n\n* * *"}, {"input": "13", "output": "78\n \n\n* * *"}, {"input": "1", "output": "0"}] |
Print the maximum possible value of M_1 + M_2 + \cdots + M_N.
* * * | s400762492 | Accepted | p02924 | Input is given from Standard Input in the following format:
N | print(sum(range(int(input()))))
| Statement
For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of
\\{1, 2, ..., N\\}.
Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.
Find the maximum possible value of M_1 + M_2 + \cdots + M_N. | [{"input": "2", "output": "1\n \n\nWhen the permutation \\\\{P_1, P_2\\\\} = \\\\{2, 1\\\\} is chosen, M_1 + M_2 = 1 + 0\n= 1.\n\n* * *"}, {"input": "13", "output": "78\n \n\n* * *"}, {"input": "1", "output": "0"}] |
Print the maximum possible value of M_1 + M_2 + \cdots + M_N.
* * * | s744368217 | Wrong Answer | p02924 | Input is given from Standard Input in the following format:
N | s = input().split()
a = int(s[0])
max = 0
b = 1
for i in range(2, a + 1):
max = max + b % i
b += 1
if not a == 1:
max += 1
print(max)
| Statement
For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of
\\{1, 2, ..., N\\}.
Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.
Find the maximum possible value of M_1 + M_2 + \cdots + M_N. | [{"input": "2", "output": "1\n \n\nWhen the permutation \\\\{P_1, P_2\\\\} = \\\\{2, 1\\\\} is chosen, M_1 + M_2 = 1 + 0\n= 1.\n\n* * *"}, {"input": "13", "output": "78\n \n\n* * *"}, {"input": "1", "output": "0"}] |
Print the maximum possible value of M_1 + M_2 + \cdots + M_N.
* * * | s793009206 | Wrong Answer | p02924 | Input is given from Standard Input in the following format:
N | A = int(input())
if A > 2:
kotae = (2 + A - 1) * (A - 2) / 2
kotae = kotae + 1
kotae = int(kotae)
elif A == 2:
kotae = 1
else:
kotae = 0
print(kotae)
| Statement
For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of
\\{1, 2, ..., N\\}.
Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.
Find the maximum possible value of M_1 + M_2 + \cdots + M_N. | [{"input": "2", "output": "1\n \n\nWhen the permutation \\\\{P_1, P_2\\\\} = \\\\{2, 1\\\\} is chosen, M_1 + M_2 = 1 + 0\n= 1.\n\n* * *"}, {"input": "13", "output": "78\n \n\n* * *"}, {"input": "1", "output": "0"}] |
Print the maximum possible value of M_1 + M_2 + \cdots + M_N.
* * * | s744687276 | Runtime Error | p02924 | Input is given from Standard Input in the following format:
N | n = (int)(input)
print((n - 1) * n) // 2
| Statement
For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of
\\{1, 2, ..., N\\}.
Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.
Find the maximum possible value of M_1 + M_2 + \cdots + M_N. | [{"input": "2", "output": "1\n \n\nWhen the permutation \\\\{P_1, P_2\\\\} = \\\\{2, 1\\\\} is chosen, M_1 + M_2 = 1 + 0\n= 1.\n\n* * *"}, {"input": "13", "output": "78\n \n\n* * *"}, {"input": "1", "output": "0"}] |
Print the maximum possible value of M_1 + M_2 + \cdots + M_N.
* * * | s530253826 | Wrong Answer | p02924 | Input is given from Standard Input in the following format:
N | N = float(input())
print(int(N * (N - 1) / 2.0))
| Statement
For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of
\\{1, 2, ..., N\\}.
Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.
Find the maximum possible value of M_1 + M_2 + \cdots + M_N. | [{"input": "2", "output": "1\n \n\nWhen the permutation \\\\{P_1, P_2\\\\} = \\\\{2, 1\\\\} is chosen, M_1 + M_2 = 1 + 0\n= 1.\n\n* * *"}, {"input": "13", "output": "78\n \n\n* * *"}, {"input": "1", "output": "0"}] |
Print the maximum possible value of M_1 + M_2 + \cdots + M_N.
* * * | s235925076 | Wrong Answer | p02924 | Input is given from Standard Input in the following format:
N | print(int((lambda n: n * (n + 1) / 2 - n)(int(input()))))
| Statement
For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of
\\{1, 2, ..., N\\}.
Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.
Find the maximum possible value of M_1 + M_2 + \cdots + M_N. | [{"input": "2", "output": "1\n \n\nWhen the permutation \\\\{P_1, P_2\\\\} = \\\\{2, 1\\\\} is chosen, M_1 + M_2 = 1 + 0\n= 1.\n\n* * *"}, {"input": "13", "output": "78\n \n\n* * *"}, {"input": "1", "output": "0"}] |
Print the maximum possible value of M_1 + M_2 + \cdots + M_N.
* * * | s396346090 | Wrong Answer | p02924 | Input is given from Standard Input in the following format:
N | while True:
try:
N = int(input())
print(N * (N - 1) / 2)
except EOFError:
break
| Statement
For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of
\\{1, 2, ..., N\\}.
Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.
Find the maximum possible value of M_1 + M_2 + \cdots + M_N. | [{"input": "2", "output": "1\n \n\nWhen the permutation \\\\{P_1, P_2\\\\} = \\\\{2, 1\\\\} is chosen, M_1 + M_2 = 1 + 0\n= 1.\n\n* * *"}, {"input": "13", "output": "78\n \n\n* * *"}, {"input": "1", "output": "0"}] |
Print the maximum possible value of M_1 + M_2 + \cdots + M_N.
* * * | s512598252 | Wrong Answer | p02924 | Input is given from Standard Input in the following format:
N | s = int(input())
print(int(s * (s - 1) / 2))
| Statement
For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of
\\{1, 2, ..., N\\}.
Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.
Find the maximum possible value of M_1 + M_2 + \cdots + M_N. | [{"input": "2", "output": "1\n \n\nWhen the permutation \\\\{P_1, P_2\\\\} = \\\\{2, 1\\\\} is chosen, M_1 + M_2 = 1 + 0\n= 1.\n\n* * *"}, {"input": "13", "output": "78\n \n\n* * *"}, {"input": "1", "output": "0"}] |
Print the abbreviation of s.
* * * | s568213715 | Accepted | p03636 | Input is given from Standard Input in the following format:
s | a, *l, b = input()
print(a + str(len(l)) + b)
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s422829693 | Accepted | p03636 | Input is given from Standard Input in the following format:
s | c, *s, d = input()
print(c + str(len(s)) + d)
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s439924611 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | print(s[0] + str((len - 2)) + s[-1])
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s340657908 | Wrong Answer | p03636 | Input is given from Standard Input in the following format:
s | #!/usr/bin/env python3
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s291580287 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | a, b*, c = input()
print(a+str(len(b))+c) | Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s741781538 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | print(s[0] + s.count(s - 2) + s[-1])
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s737261089 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | print(input()[0] + len(input()[1:-1]) + input()[-1])
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s646184924 | Wrong Answer | p03636 | Input is given from Standard Input in the following format:
s | A = input()
print(A[0] + str(len(A[1:-2])) + A[-1])
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s340943854 | Accepted | p03636 | Input is given from Standard Input in the following format:
s | moji = str(input())
print(moji[0] + str(len(moji) - 2) + moji[-1])
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s706155730 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | s=input()
ss=len(s[1:len(s)-1])
sss=str(ss)
print(s[0]+sss+s[-1]) | Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s611024966 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | a=input()
print('{}{}{}'.format(a[0],str(len(a)-2),a[-1]) | Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s440490814 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | a = list(input())
n = len(a)-2
print(a[0],n,a[-1],sep=("")
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s210862171 | Accepted | p03636 | Input is given from Standard Input in the following format:
s | word = input()
S = word[0]
L = word[-1]
num = len(word)
print(S + str(num - 2) + L)
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s283511882 | Accepted | p03636 | Input is given from Standard Input in the following format:
s | s, *t, r = input()
print(s + "%d" % len(t) + r)
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s461924267 | Wrong Answer | p03636 | Input is given from Standard Input in the following format:
s | print(input().replace("2017", "2018"))
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s668790935 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | a, *b, c = input()
print(a + str(len(b) + c) | Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s196949692 | Wrong Answer | p03636 | Input is given from Standard Input in the following format:
s | print(sorted(map(int, "2 1 4 3".split())))
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s690197617 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | S = input()
a = len(S)
print(str(S[0]+a+S[-1]) | Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s099433438 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | s=input()
l=str((len(s)-2)
print(s[0]+l+s[-1]) | Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s619548957 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | a
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s062197881 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | print(S[0] + (S.length() - 2) + S[-1])
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s730664768 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | s = input()
print(s[0] + str(len(s) + s[-1]) | Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s498058137 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | a = input()
print([:1]+(len(a)-2)+[-1:]) | Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s427231403 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | S = input()
print(S[:1] + str(len(S}-2) + S[-1:])
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s439196531 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | s = input()
print(s[0] + str(len(s) - 2) + s[-1])s | Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s989071824 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | s = input()
print(s[0] + str(len(s) - 2) + s[-1])) | Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s837212907 | Accepted | p03636 | Input is given from Standard Input in the following format:
s | list = list(input())
print(list[0] + str(len(list) - 2) + list[-1])
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s780928578 | Accepted | p03636 | Input is given from Standard Input in the following format:
s | write = input()
print(write[0] + str(len(write) - 2) + write[-1])
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s288557724 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | s = input()
l = len(s)
print(s[0] + str(l-2) + s s[-1]) | Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s575043206 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | s=input()
print(s[0]+str((len(s)-2)+s[-1])
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s116984096 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | s = input()
print('{}{}{}'.format(s[0], len(s)-1, s[-1]) | Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s023991858 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | n = sorted(list(map(int, input().split())))
print(int(n[0] * n[1] / 2))
| Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Print the abbreviation of s.
* * * | s688760550 | Runtime Error | p03636 | Input is given from Standard Input in the following format:
s | s = input()
print({}{}{}).format(s[0],len(s)-2,s[-1]) | Statement
The word `internationalization` is sometimes abbreviated to `i18n`. This comes
from the fact that there are 18 letters between the first `i` and the last
`n`.
You are given a string s of length at least 3 consisting of lowercase English
letters. Abbreviate s in the same way. | [{"input": "internationalization", "output": "i18n\n \n\n* * *"}, {"input": "smiles", "output": "s4s\n \n\n* * *"}, {"input": "xyz", "output": "x1z"}] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.