結果
| 問題 | No.3705 ビバ子とマカロン (Bibako and Macaron) |
| コンテスト | |
| ユーザー |
Tuchmos
|
| 提出日時 | 2026-09-10 16:50:53 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1,916 ms / 3,000 ms |
| + 684µs | |
| コード長 | 999 bytes |
| 記録 | |
| コンパイル時間 | 74 ms |
| コンパイル使用メモリ | 81,152 KB |
| 実行使用メモリ | 189,332 KB |
| 最終ジャッジ日時 | 2026-09-10 16:51:39 |
| 合計ジャッジ時間 | 41,486 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| 小課題1 | 10 % | AC * 5 |
| 小課題2 | 30 % | AC * 8 |
| 小課題3 | 60 % | AC * 15 |
| 合計 | 100 点 |
ソースコード
from atcoder.segtree import SegTree
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
cnt=[0]*(N+1)
for a in A:
cnt[a]+=1
def op(x,y):
return min(x,y)
INF=10**18
seg=SegTree(op,INF,cnt)
ans=[]
for _ in range(Q):
l,r,L,R=map(int,input().split())
if max(l,L)>min(r,R):
mn=seg.prod(l,r+1)
MN=seg.prod(L,R+1)
if mn>=1 and MN>=1:
ans.append('Yes')
else:
ans.append('No')
continue
if l>L:
l,r,L,R=L,R,l,r
if R<r:
left=seg.prod(l,L)
mid=seg.prod(L,R+1)
right=seg.prod(R+1,r+1)
if left>=1 and mid>=2 and right>=1:
ans.append('Yes')
else:
ans.append('No')
else:
left=seg.prod(l,L)
mid=seg.prod(L,r+1)
right=seg.prod(r+1,R+1)
if left>=1 and mid>=2 and right>=1:
ans.append('Yes')
else:
ans.append('No')
import sys
sys.stdout.write('\n'.join(map(str,ans))+'\n')
Tuchmos