結果
| 問題 |
No.2358 xy+yz+zx=N
|
| コンテスト | |
| ユーザー |
とろちゃ
|
| 提出日時 | 2023-06-23 22:47:04 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,014 bytes |
| コンパイル時間 | 175 ms |
| コンパイル使用メモリ | 82,408 KB |
| 実行使用メモリ | 83,272 KB |
| 最終ジャッジ日時 | 2024-07-01 17:40:43 |
| 合計ジャッジ時間 | 6,796 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 3 WA * 1 TLE * 2 -- * 4 |
ソースコード
# import pypyjit;pypyjit.set_param("max_unroll_recursion=-1")
# from bisect import *
# from collections import *
# from heapq import *
from itertools import *
# from math import *
# from datetime import *
# from decimal import*
# from string import ascii_lowercase,ascii_uppercase
# import numpy as np
import sys
import os
# sys.setrecursionlimit(10**6)
INF = 10**18
MOD = 998244353
# MOD = 10**9 + 7
File = open("input.txt", "r") if os.path.exists("input.txt") else sys.stdin
def input():
return File.readline()[:-1]
# ///////////////////////////////////////////////////////////////////////////
N = int(input())
ans = set()
for x in range(N + 1):
for y in range(x + 1, N + 1):
if x * y > N:
continue
try:
z = (N - x * y) / (x + y)
except:
continue
if z.is_integer() and z >= 0:
ans.add((x, y, int(z)))
for i in list(ans):
for j in permutations(i):
ans.add(j)
print(len(ans))
for i in ans:
print(*i)
とろちゃ