跳到正文

个人记录

守望者的逃离

zzzzzz2约 5 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2026年5月16日
篇幅
约 5 分钟
获赞
1

版本

  1. v1当前

终于做出来了。

90

C++
#include<iostream>
using namespace std;
int main(){
	long long m,s,t;
	cin>>m>>s>>t;
	long long w=m/10,v=(s+59)/60;
	m=m%10;
	if(t<v&&w>=t){
		cout<<"No"<<endl;
		cout<<t*60;
		return 0;
	}
	if(t<v){
		cout<<"No"<<endl;
		t-=w;
		while(t+m/4>=7){
			m=m/4;
			t=t-5+m;
			t--;
			t--;
			m=0;
			w++;
			w++;
		}
		while(t+m/4>=4){
			m=m/4;
			t=t-3+m;
			t--;
			m=0;
			w++;
		}
		cout<<w*60+t*17;
		return 0;
	}
	if(w>=v&&v<=t){
		cout<<"Yes"<<endl;
		cout<<v;
		return 0;
	}
	long long tamp=w;
	long long l=m;
	t=t-w;
	while(t+m/4>=7){
		m=m/4;
		t=t-5+m;
		t--;
		t--;
		m=0;
		w++;
		w++;
	}
	while(t+m/4>=4){
		m=m/4;
		t=t-3+m;
		t--;
		m=0;
		w++;
	}
	if(w*60+t*17<s){
		cout<<"No"<<endl;
		cout<<w*60+t*17;
		return 0;
	}
	cout<<"Yes"<<endl;
	s-=tamp*60;
	while(s>=51){
		tamp++;
		l+=4;
		if(l>=10){
			l-=10;
			s-=60;
			tamp++;
		}
	}
	if(s>0){
		tamp+=(s+16)/17;
	}
	cout<<tamp;
	return 0;
}

60

C++
#include<iostream>
using namespace std;
int main(){
	int m,s,t;
	int cnt=0,l=0;
	cin>>m>>s>>t;
	int w=m/10,v=(s+59)/60;
	m=m%10;
	while(m>=2&&v>=w&&cnt+w+2<=t){
		m+=4;
		cnt++;
		if(m>=10){
			m-=10;
			w++;
		}
	}
	v=s/60;
	v-=w;
	v=v/2*5;
	l=w*60+v*2/5*60;
	cnt+=v+v*2/5+w;
	s-=l;
	cnt+=(s+16)/17;
	if(t>=cnt){
		cout<<"Yes"<<endl<<cnt;
	}
	else{
		if(t<v+v*2/5+w){
			l=t*60;
		}
		else{
			t-=v+v*2/5+w;
			l+=t*17;
		}
		cout<<"No"<<endl<<l;
	}
	return 0;
}

100

C++
#include<iostream>
using namespace std;
int main(){
	int m,s,t;
	cin>>m>>s>>t;
	int v=m/10;
	int l=0,cnt=0;
	m=m%10;
	if(min(v,t)*60>s){
		cout<<"Yes"<<endl<<(s+59)/60;
		return 0;
	}
	l+=min(v,t)*60;
	s-=min(v,t)*60;
	cnt+=min(v,t);
	t-=min(v,t);
	v=0;
	while(t>0&&s>0){
		if(s<=(4-(m+2)/4)*17){
			s-=17;
			t--;
			cnt++;
			l+=17;
		}
		else if(s<=(7-m/4)*17){
			for(int i=1;i<=4-(m+2)/4;i++){
				if(t<=0){
					cout<<"No"<<endl<<l+i*17;
					return 0;
				}
				t--;
				cnt++;
			}
			s-=60;
			l+=60;
			m=0;
		}
		else{
			int w=0;
			for(int i=1;i<=7;i++){
				if(m>=4){
					m-=4;
				}
				else{
					if(t<=0){
						cout<<"No"<<endl<<l+w*17;
						return 0;
					}
					w++;
					t--;
					cnt++;
				}
			}
			s-=120;
			l+=120;
		}
	}
	if(s<=0){
		cout<<"Yes"<<endl<<cnt;
	}
	else{
		cout<<"No"<<endl<<l;
	}
	return 0;
}
原文