样例都过不了......
查看原帖
样例都过不了......
776355
chrisxu1楼主2024/2/25 21:26
#include<iostream>
#include<iomanip>
#include<string>
#include<cstring>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<queue>
using namespace std;
long long m, s, t;
int main(){
	//freopen("fraction.in","r",stdin);
	//freopen("fraction.out","w",stdout);
	cin >> m >> s >> t;
	long long need = 0;
	for(int i = 1; i <= t; i ++){
		while(m >= 10 && i <= t){
			i ++;
			if(i > t){
				break;
			}
			m -= 10;
			if(m < 10){
				break;
			}
			need += 60;
			s -= 60;
			if(s <= 0){
				cout << "Yes" << endl;
				cout << i;
				return 0;
			}
		}
		cout << m + (t - i - 1) * 4 << " " << m << endl;
		if(m + (t - i - 1) * 4 >= 10){
			while(m < 10 && i <= t){
				i ++;
				if(i > t){
					break;
				}
				m += 4;
			}
		} else {
			while(i <= t){
				i ++;
				if(i > t){
					break;
				}
				need += 17;
				s -= 17;
				if(s <= 0){
					cout << "Yes" << endl;
					cout << i;
					return 0;
				}
			}
		}
		if(i > t){
			break;
		}
	}
	cout << "No" << endl;
	cout << need;
	//fclose(stdin);
	//fclose(stdout);
	return 0;
}
2024/2/25 21:26
加载中...