結果
| 問題 |
No.3282 Photos and Friends
|
| コンテスト | |
| ユーザー |
timi
|
| 提出日時 | 2025-09-26 21:55:53 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 405 bytes |
| コンパイル時間 | 378 ms |
| コンパイル使用メモリ | 82,220 KB |
| 実行使用メモリ | 106,824 KB |
| 最終ジャッジ日時 | 2025-09-26 21:56:05 |
| 合計ジャッジ時間 | 10,778 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 19 WA * 31 |
ソースコード
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
if f==-1:
print('No')
exit()
if l<=P and ll<=Q:
plus=P-l
print('Yes')
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
print(p,q)
else:
print('No')
timi