結果

問題 No.3402 [Cherry Anniversary 5] Beyond Zelkova, the 5th year vista seen through the bloom of a cherry bloosom
コンテスト
ユーザー pengin_2000
提出日時 2025-12-13 03:42:11
言語 C
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 864 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 188 ms
コンパイル使用メモリ 39,620 KB
最終ジャッジ日時 2026-02-22 13:53:24
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other AC * 13 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<stdio.h>
int is_leap(int n)
{
	if (n % 400 == 0)
		return 1;
	else if (n % 100 == 0)
		return -1;
	else if (n % 4 == 0)
		return 1;
	else
		return -1;
}
int md[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
int cal(int y, int m, int d)
{
	int res = 0;
	res += 365 * y;
	res += y / 4;
	res -= y / 100;
	res += y / 400;
	int i;
	for (i = 0; i < m; i++)
		res += md[i];
	if (is_leap(y) > 0 && m > 2)
		res++;
	res += d;
	return res;
}
int main()
{
	int ys, ms, ds;
	scanf("%d %d %d", &ys, &ms, &ds);
	int ye, me, de;
	scanf("%d %d %d", &ye, &me, &de);
	int q;
	scanf("%d", &q);
	int y, m, d;
	int a, b;
	b = cal(ye, me, de) - cal(ys, ms, ds) + 1;
	for (; q > 0; q--)
	{
		scanf("%d %d %d", &y, &m, &d);
		a = cal(y, m, d) - cal(ye, me, de);
		if (a < b)
			printf("Less\n");
		else if (a == b)
			printf("Same\n");
		else
			printf("More\n");
	}
	return 0;
}
0