比赛 NOIP2007普及组(复现) 评测结果 WAWWWWWWWW
题目名称 守望者的逃离 最终得分 10
用户昵称 wangzihan 运行时间 0.004 s
代码语言 C 内存使用 4.40 MiB
提交时间 2020-02-09 17:49:52
显示代码纯文本
#include<stdio.h>

int main()
{
	
	int M, S, T;
	int a, b, t, s, c;
	freopen("escape.in","r",stdin);
	freopen("escape.out","w",stdout);
	scanf("%d %d %d", &M, &S, &T);
	a = M / 10;
	b = M % 10;
	if (b < 2)
		s = S - a * 60;
	else if (b > 1 && b < 6)
	{
		s = S - (a + 1) * 60;
		c = a + 3;
	}
	else if (b > 5 && b < 8)
	{
		s = S - (a + 1) * 60;
		c = a + 2;
	}
	else
	{
		s = S - (a + 2) * 60;
		c = a + 5;
	}

	if (s % 17 != 0)
		t = s / 17 + 1;
	else
		t = s / 17;
	if (c + t <= T&&t>=0)
		printf("Yes\n%d", c + t);
	else
	{
		if (T <= a)
			s = t * 60;
		else if (T > a&& t < c)
		{
			if (c != a + 5)
				s = a * 60 + (T - a) * 17;
			else
			{
				if (T - a < 2)
					s = a * 60 + (T - a) * 17;
				else
					s = (a + 1) * 60 + (T - a - 2) * 17;
			}
		}
		else if (T > c&& c != a + 5)
			s = (a + 1) * 60 + (T - c) * 17;
		else
			s = (a + 2) * 60 + (T - c) * 17;
		printf("No\n%d", s);
	}
	return 0;
}