Files
workspace/c/luogu/p1095.cpp
e2hang ebcee63b7c New
2026-01-09 00:05:37 +08:00

45 lines
897 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#include <iostream>
#include <vector>
using namespace std;
int main(){
int m, s, t;
cin >> m >> s >> t;
//考虑两次dp一次算蓝一次算跑步选最短时间的
vector<int> dp(t + 1, 0);
for(int i = 1; i <= t; ++i){
//单纯算蓝
if(m >= 10) {
dp[i] = dp[i - 1] + 60;
m -= 10;
}
else {
dp[i] = dp[i - 1];
m += 4;
}
}
for(int i = 1; i <= t; ++i){
//单纯算步
if(dp[i] < dp[i - 1] + 17){
dp[i] = dp[i - 1] + 17;
}
}
if(dp[t] >= s){
cout << "Yes" << endl;
for(int i = 0; i <= t; ++i){
if(dp[i] >= s){
cout << i << endl;
return 0;
}
}
}
else {
cout << "No" << endl;
cout << dp[t] << endl;
}
return 0;
}