結果
| 問題 |
No.3282 Photos and Friends
|
| コンテスト | |
| ユーザー |
timi
|
| 提出日時 | 2025-09-26 22:20:16 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 540 bytes |
| コンパイル時間 | 254 ms |
| コンパイル使用メモリ | 82,492 KB |
| 実行使用メモリ | 123,420 KB |
| 最終ジャッジ日時 | 2025-09-26 22:20:33 |
| 合計ジャッジ時間 | 10,871 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 26 WA * 24 |
ソースコード
N,P,Q=map(int, input().split())
A=[]
f=1
l,r=0,0
ll,rr=0,0
for i in range(N):
x,a,b=map(int, input().split())
A.append((x,a,b))
if a+b<x:
f=-1
l+=x-b;r+=a
ll+=x-a;rr+=b
u,v=P-l,rr-Q
if u<0:
f=-1
if v>=0 and u<v:
f=-1
if v<0:
plus=0
if u>=0 and v>=0:
plus=min(u,v)
ans=[]
pp,qq=0,0
for x,a,b in A:
p,q=x-b,b
w=max(0,a-(x-b))
w=min(plus,w)
p+=w;q-=w
plus-=w
ans.append((p,q))
pp+=p
qq+=q
if plus!=0:
f=-1
if f==-1:
print('No')
exit()
print('Yes')
for x,y in ans:
print(x,y)
timi