2 条题解
-
1Roy (杨梅奈昔) LV 6 MOD @ 2024-08-21 15:11:45
#include<iostream> using namespace std; int n,Y,G,y,g,k,cnt; int main() { cin>>n>>Y>>G; for(int i=1;i<=n;i++) { cin>>y>>g>>k; if(y+k>=Y) cnt++; if(g-k<=G) cnt++; if(g-k<=G&&y+k>=Y) cnt++; } cout<<cnt; return 0; }
-
02024-08-21 14:51:29@
#include<bits/stdc++.h>
using namespace std;
int n,minY,minG;
int cnt,Y,K,G;
signed main()
{
cin>>n>>minY>>minG;
while(n--)
{
cin>>Y>>G>>K;
if(Y+K>=minY) cnt++;
if(G-K<=minG) cnt++;
if(Y+K>=minY&&G-K<=minG) cnt++;
}
cout<<cnt;
return 0;
}
- 1