Submission #6157626
Source Code Expand
from collections import Counter from collections import deque from functools import reduce from pprint import pprint import bisect import copy import fractions import itertools import math import queue import random import sys import time sys.setrecursionlimit(10**7) INF = 10 ** 18 MOD = 10 ** 9 + 7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LF(): return [float(x) for x in sys.stdin.readline().split()] def LS(): return sys.stdin.readline().split() def MI(): return map(int, sys.stdin.readline().split()) def II(): return int(sys.stdin.readline()) def IS(): return input() def C(x): return Counter(x) def GCD_LIST(numbers): return reduce(fractions.gcd, numbers) def LCM_LIST(numbers): return reduce(LCM, numbers) def LCM(m, n): return (m * n // fractions.gcd(m, n)) class UnionFind(): def __init__(self, n): self.n = n self.node = [i for i in range(n)] self.size = [1 for _ in range(n)] def same(self, x, y): return bool(self.root(x) == self.root(y)) def root(self, x): if self.node[x] == x: return x else: self.node[x] = self.root(self.node[x]) # 経路圧縮 return self.node[x] def unite(self, x, y): x, y = self.root(x), self.root(y) if x == y: return # 結合不要 if self.size[x] < self.size[y]: x, y = y, x self.node[y] = x self.size[x] += self.size[y] def return_size(self, x): return self.size[self.root(x)] n = II() if n == 1 or n == 2: print(n) else: max_element = 0 index = 1 for i in range(1, n+1): for j in range(i): if index == n + 1: break max_element = i index += 1 s = 0 for num in range(max_element, 0, -1): s += num if s <= n: print(num) else: s -= num
Submission Info
Submission Time | |
---|---|
Task | B - Exactly N points |
User | mobtake |
Language | PyPy3 (2.4.0) |
Score | 300 |
Code Size | 1994 Byte |
Status | AC |
Exec Time | 647 ms |
Memory | 71512 KB |
Judge Result
Set Name | sample | dataset1 | dataset2 | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | 100 / 100 | ||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
sample | sample-01.txt, sample-02.txt, sample-03.txt |
dataset1 | sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt |
dataset2 | sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt, sample-01.txt, sample-02.txt, sample-03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | AC | 288 ms | 66028 KB |
01-02.txt | AC | 280 ms | 65388 KB |
01-03.txt | AC | 275 ms | 65388 KB |
01-04.txt | AC | 274 ms | 65388 KB |
01-05.txt | AC | 275 ms | 65260 KB |
01-06.txt | AC | 292 ms | 65388 KB |
01-07.txt | AC | 276 ms | 65388 KB |
01-08.txt | AC | 278 ms | 65388 KB |
01-09.txt | AC | 276 ms | 65388 KB |
01-10.txt | AC | 277 ms | 65388 KB |
02-01.txt | AC | 637 ms | 71256 KB |
02-02.txt | AC | 635 ms | 71384 KB |
02-03.txt | AC | 638 ms | 71256 KB |
02-04.txt | AC | 647 ms | 71256 KB |
02-05.txt | AC | 638 ms | 71256 KB |
02-06.txt | AC | 427 ms | 71512 KB |
02-07.txt | AC | 371 ms | 71256 KB |
02-08.txt | AC | 620 ms | 71256 KB |
sample-01.txt | AC | 279 ms | 65388 KB |
sample-02.txt | AC | 277 ms | 65388 KB |
sample-03.txt | AC | 278 ms | 65388 KB |