結果
| 問題 | No.3705 ビバ子とマカロン (Bibako and Macaron) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-10 17:15:09 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 884 ms / 3,000 ms |
| + 115µs | |
| コード長 | 992 bytes |
| 記録 | |
| コンパイル時間 | 4,454 ms |
| コンパイル使用メモリ | 378,468 KB |
| 実行使用メモリ | 15,488 KB |
| 最終ジャッジ日時 | 2026-09-10 17:15:46 |
| 合計ジャッジ時間 | 33,297 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| 小課題1 | 10 % | AC * 5 |
| 小課題2 | 30 % | AC * 8 |
| 小課題3 | 60 % | AC * 15 |
| 合計 | 100 点 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#if __has_include("all.hpp")
#include "all.hpp"
#else
#include <atcoder/all>
#endif
using namespace atcoder;
long long op(long long a, long long b) { return min(a,b); }
long long e() { return 1e6; }
int main(void){
int n;
cin>>n;
vector<long long>a(n,0);
for(int i=0;i<n;i++){
int b;
cin>>b;
a[b-1]++;
}
segtree<long long, op, e> seg(a);
int q;
cin>>q;
while(q--){
int l,r,l2,r2;
cin>>l>>r>>l2>>r2;
int flag=1;
if((l<=r&&r<l2&&l2<=r2)||(l2<=r2&&r2<l&&l<=r)){
if(seg.prod(l-1,r)<1)flag=0;
if(seg.prod(l2-1,r2)<1)flag=0;
}else{
vector<int>a2={l,r,l2,r2};
sort(a2.begin(),a2.end());
if(seg.prod(a2[0]-1,a2[1])<1)flag=0;
if(seg.prod(a2[1]-1,a2[2])<2)flag=0;
if(seg.prod(a2[2]-1,a2[3])<1)flag=0;
}
cout<<(flag?"Yes":"No")<<endl;
}
return 0;
}