12 条题解
-
412209水宇辰 (12209水宇辰) LV 9 @ 2022-06-10 15:37:21
#include<iostream> using namespace std; int main() { int n,h,x,y,l=0; cin>>n>>h; for(int i=1;i<=n;i++) { cin>>x>>y; if(x<=h) l+=y; } cout<<l; return 0; }
-
12024-07-17 08:25:36@
#include<iostream>
using namespace std;
int main()
{
int a,b,n,h,v=0;
cin>>n>>h;
for(int i=1;i<=n;i++)
{
cin>>a;
cin>>b;
if(a<=h)
v=b+v;
}
cout<<v;
} -
02024-08-04 10:15:44@
#include<iostream>
using namespace std;
int main()
{
int n,h,x,y,l=0;
cin>>n>>h;
for(int i=1;i<=n;i++)
{
cin>>x>>y;
if(x<=h)
l+=y;
}
cout<<l;
return 0;
}//541881314 -
-22022-01-05 21:00:21@
#include<bits/stdc++.h> using namespace std; int main() { int n,h,sum=0; cin>>n>>h; pair<int,int> p[n]; for(int i=0;i<n;i++) cin>>p[i].first>>p[i].second; for(int i=0;i<n;i++) if(p[i].first<=h) sum+=p[i].second; cout<<sum; return 0; }
-
-42021-12-27 09:48:38@
#include<iostream>
using namespace std;
int main(){
int n,h,cnt=0;
cin>>n>>h;
for(int i=1;i<=n;i++){
int hight,heavy;
cin>>hight>>heavy;
if(hight<=h){
cnt+=heavy;
}
}
cout<<cnt;
return 0;
} -
-42021-12-16 20:07:30@
#include<iostream> using namespace std; int main() { int n,h,x,y,l=0; cin>>n>>h; for(int i=1;i<=n;i++) { cin>>x>>y; if(x<=h) l+=y; } cout<<l; return 0; }
-
-42021-12-16 20:07:25@
#include<iostream> using namespace std; int main() { int n,h,x,y,l=0; cin>>n>>h; for(int i=1;i<=n;i++) { cin>>x>>y; if(x<=h) l+=y; } cout<<l; return 0; }
-
-42021-12-16 20:07:19@
#include<iostream> using namespace std; int main() { int n,h,x,y,l=0; cin>>n>>h; for(int i=1;i<=n;i++) { cin>>x>>y; if(x<=h) l+=y; } cout<<l; return 0; }
-
-62021-12-01 13:40:21@
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int main()
{
int n,h,x,y;
cin>>n>>h;
int sum=0;
for(int i=0;i<n;i++)
{
cin>>x>>y;
if(x<=h)
sum+=y;
}
cout<<sum;
return 0;
} -
-62021-11-28 11:27:15@
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int main()
{
int n,h,x,y;
cin>>n>>h;
int sum=0;
for(int i=0;i<n;i++)
{
cin>>x>>y;
if(x<=h)
sum+=y;
}
cout<<sum;
return 0;
} -
-72021-12-13 11:14:53@
#include<iostream>
using namespace std;
int main()
{
int n,h,x,y,l=0;
cin>>n>>h;
for(int i=1;i<=n;i++)
{
cin>>x>>y;
if(x<=h)
l+=y;
}
cout<<l;
return 0;
} -
-92021-04-28 22:14:57@
用容器的最短代码。。通俗易懂
#include<bits/stdc++.h> using namespace std; int main(){ int n,h,sum=0; cin>>n>>h; pair<int,int> p[n]; for(int i=0;i<n;i++) cin>>p[i].first>>p[i].second; for(int i=0;i<n;i++) if(p[i].first<=h) sum+=p[i].second; cout<<sum; return 0; }
- 1
信息
- ID
- 1002
- 难度
- 3
- 分类
- (无)
- 标签
- 递交数
- 504
- 已通过
- 233
- 通过率
- 46%
- 被复制
- 8
- 上传者