日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

Codeforces Round #477 (rated, Div. 2, based on VK Cup 2018 Round 3)

發布時間:2025/4/16 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Codeforces Round #477 (rated, Div. 2, based on VK Cup 2018 Round 3) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

點擊打開A題鏈接

#include<bits/stdc++.h> using namespace std; const int MAX = 105; int n,s;int h[MAX],m[MAX],mins[MAX]; int main() {cin>>n>>s;//t[0] = 0;for(int i=0;i<n;++i){cin>>h[i]>>m[i];mins[i] = h[i] * 60 + m[i];}if(mins[0]>=s+1){cout<<0<<" "<<0<<endl;return 0;}bool flag = false;for(int i=1;i<n;++i){if( mins[i]-mins[i-1] >= 2 * (s+1)){flag = 1;cout<< (mins[i-1] + s + 1)/60 <<" "<<(mins[i-1] + s + 1)%60;break;}}if(!flag)cout<< (mins[n-1] + s + 1)/60 <<" "<<(mins[n-1] + s + 1)%60;return 0; }

點擊打開B題鏈接

#include<bits/stdc++.h> using namespace std; int main() {int n,a,b;cin>>n>>a>>b;int s[100005];long long S=0;for(int i=0;i<n;++i){scanf("%d",&s[i]);S+=s[i];}sort(s+1,s+n);int ans=0;for(int i=n-1;i>=1;--i){double k=a*s[0]/((double)S*1.0);//cout<<k<<endl;/* if(k>b){cout<<ans<<endl;break;}else{S-=s[i];ans++;}*/if(k < b){S -= s[i];ans ++;}else// break;{//cout<<ans<<endl;break;}}cout<<ans<<endl;return 0; }

總結

以上是生活随笔為你收集整理的Codeforces Round #477 (rated, Div. 2, based on VK Cup 2018 Round 3)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。