提出 #71314472


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
const int N=1000100,INF=2e18,MOD=998244353;
int t,n,k,x,y,z,m,h,j,u,cnt,mi,tt,rr,mx,res,ans,ll,q;
int a[N],b[N],c[N];
signed main(){
    cin>>t;
    while(t--){
        cin>>n>>h;
        int l=h;
        int r=h;
        int time=0;
        res=0;
        for(int i=1;i<=n;i++){
            cin>>x>>y>>z;
            tt=x-time;
            time=x;
            r+=tt;
            l=max(1ll,l-tt);
            if(r<y||l>z){
                res=1;
            }
            l=max(l,y);
            r=min(r,z);
        }
        if(res==1){
            cout<<"No"<<endl;
        }else{
            cout<<"Yes"<<endl;
        }
    }
}

提出情報

提出日時
問題 C - Flapping Takahashi
ユーザ mengqing
言語 C++23 (GCC 15.2.0)
得点 300
コード長 752 Byte
結果 AC
実行時間 138 ms
メモリ 3608 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 1
AC × 29
セット名 テストケース
Sample 00_sample_00.txt
All 00_sample_00.txt, 01_small_00.txt, 01_small_01.txt, 01_small_02.txt, 01_small_03.txt, 01_small_04.txt, 01_small_05.txt, 01_small_06.txt, 01_small_07.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt, 02_random_10.txt, 02_random_11.txt, 02_random_12.txt, 02_random_13.txt, 02_random_14.txt, 02_random_15.txt, 02_random_16.txt, 02_random_17.txt, 02_random_18.txt, 02_random_19.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 2 ms 3408 KiB
01_small_00.txt AC 138 ms 3568 KiB
01_small_01.txt AC 106 ms 3496 KiB
01_small_02.txt AC 94 ms 3576 KiB
01_small_03.txt AC 85 ms 3440 KiB
01_small_04.txt AC 79 ms 3568 KiB
01_small_05.txt AC 75 ms 3500 KiB
01_small_06.txt AC 73 ms 3492 KiB
01_small_07.txt AC 72 ms 3568 KiB
02_random_00.txt AC 57 ms 3396 KiB
02_random_01.txt AC 72 ms 3608 KiB
02_random_02.txt AC 72 ms 3408 KiB
02_random_03.txt AC 62 ms 3608 KiB
02_random_04.txt AC 71 ms 3464 KiB
02_random_05.txt AC 71 ms 3576 KiB
02_random_06.txt AC 58 ms 3408 KiB
02_random_07.txt AC 72 ms 3608 KiB
02_random_08.txt AC 72 ms 3496 KiB
02_random_09.txt AC 38 ms 3404 KiB
02_random_10.txt AC 72 ms 3464 KiB
02_random_11.txt AC 72 ms 3492 KiB
02_random_12.txt AC 71 ms 3496 KiB
02_random_13.txt AC 72 ms 3380 KiB
02_random_14.txt AC 72 ms 3576 KiB
02_random_15.txt AC 71 ms 3576 KiB
02_random_16.txt AC 71 ms 3464 KiB
02_random_17.txt AC 71 ms 3496 KiB
02_random_18.txt AC 71 ms 3496 KiB
02_random_19.txt AC 71 ms 3564 KiB