QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#418544 | #6691. Orders | chenxii | ML | 0ms | 0kb | C++14 | 544b | 2024-05-23 14:25:22 | 2024-05-23 14:25:22 |
answer
#include<bits/stdc++.h>
#define int long long
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
const int N=1e9+10;
void solve(){
int n,k;cin>>n>>k;
int num[N];
for(int i=1;i<=n;i++){
num[i]+=k;
}
for(int i=1;i<=n;i++){
int a,b;
cin>>a>>b;
if(num[a]<b){cout<<"NO"<<endl;return;}
}
cout<<"YES"<<endl;
}
signed main(void){
IOS
int t=1;
cin>>t;
while(t--){
solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Memory Limit Exceeded
input:
2 4 5 6 12 1 3 6 15 8 1 3 100 3 200 4 300 6 100