QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#88762#5003. Etched Emerald OrbskavorkaWA 15ms8476kbPython31.7kb2023-03-17 04:43:152023-03-17 04:43:16

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-17 04:43:16]
  • 评测
  • 测评结果:WA
  • 用时:15ms
  • 内存:8476kb
  • [2023-03-17 04:43:15]
  • 提交

answer

# for I/O for local system
import sys
from os import path
if(path.exists('Input.txt')):
    sys.stdin = open("Input.txt","r")
    sys.stdout = open("Output.txt","w")

# For fast I/O
input = sys.stdin.buffer.readline
# input = sys.stdin.readline
print = sys.stdout.write

# Import libraries here whenever required
from math import *
from random import randint

# Use this because normal dict can sometimes give TLE
class mydict:
    def __init__(self, func=lambda: 0):
        self.random = randint(0, 1 << 32)
        self.default = func
        self.dict = {}
    def __getitem__(self, key):
        mykey = self.random ^ key
        if mykey not in self.dict:
            self.dict[mykey] = self.default()
        return self.dict[mykey]
    def get(self, key, default):
        mykey = self.random ^ key
        if mykey not in self.dict:
            return default
        return self.dict[mykey]
    def __setitem__(self, key, item):
        mykey = self.random ^ key
        self.dict[mykey] = item
    def getkeys(self):
        return [self.random ^ i for i in self.dict]
    def __str__(self):
        return f'{[(self.random ^ i, self.dict[i]) for i in self.dict]}'
    
# Solver function
def solve():
    n = int(input())
    if(n & (n-1) == 0):
        x = log2(n)
        ans = int(3 * (2 ** (x - 2)))
        print(str(ans) + " ")
        print(str(ans * 2) + "\n")
        return
    ch = 2
    two = 3
    # (2 * x * y) // (x + y)
    while 1:
        x = n * ch
        if(x % two == 0):
            print(str(x // two) + " ")
            print(str(x) + "\n")
            return
        ch += 1
        two += 2
            
# Main 
for _ in range(1):
    solve()

詳細信息

Test #1:

score: 100
Accepted
time: 11ms
memory: 8408kb

input:

5

output:

3 15

result:

ok single line: '3 15'

Test #2:

score: 0
Accepted
time: 12ms
memory: 8312kb

input:

7

output:

4 28

result:

ok single line: '4 28'

Test #3:

score: -100
Wrong Answer
time: 15ms
memory: 8476kb

input:

2625

output:

1750 5250

result:

wrong answer 1st lines differ - expected: '2415 2875', found: '1750 5250'