AtCoder Regular Contest 004

Submission #2558717

Source codeソースコード

#include<iostream>
using namespace std;
int m1,m2,d1,d2,sum;
int main()
{
	cin>>m1>>d1;
	cin>>m2>>d2;
	if (m1==m2) sum=d2-d1;
	else
	{
		for (int i=m1;i<=m2;i++)
		{
			if (i==2) sum+=29;
			if (i==1||i==3||i==5||i==7||i==8||i==10||i==12) sum+=31;
			if (i==4||i==6||i==9||i==11) sum+=30;
		}
		if (m1==31) sum=sum+31-d1;
		if (m1==30) sum=sum+30-d1;
		if (m1==29) sum=sum+29-d1;
		sum+=d2;
	}
	
	cout<<sum<<endl;
	return 0;
}

Submission

Task問題 A - 2点間距離の最大値 ( The longest distance )
User nameユーザ名 luogu_bot1
Created time投稿日時
Language言語 C++ (GCC 5.4.1)
Status状態 WA
Score得点 0
Source lengthソースコード長 450 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
All 0 / 100 00_max.txt,00_sample_01.txt,00_sample_02.txt,00_sample_03.txt,00_sample_04.txt,00_sample_05.txt,01_rnd_00.txt,01_rnd_01.txt,01_rnd_02.txt,01_rnd_03.txt,01_rnd_04.txt,01_rnd_05.txt,01_rnd_06.txt,01_rnd_07.txt,01_rnd_08.txt,01_rnd_09.txt,01_rnd_10.txt,01_rnd_11.txt,01_rnd_12.txt,01_rnd_13.txt,01_rnd_14.txt,01_rnd_15.txt,01_rnd_16.txt,01_rnd_17.txt,01_rnd_18.txt,01_rnd_19.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
00_max.txt WA
00_sample_01.txt WA
00_sample_02.txt WA
00_sample_03.txt WA
00_sample_04.txt WA
00_sample_05.txt WA
01_rnd_00.txt WA
01_rnd_01.txt WA
01_rnd_02.txt WA
01_rnd_03.txt WA
01_rnd_04.txt WA
01_rnd_05.txt WA
01_rnd_06.txt WA
01_rnd_07.txt WA
01_rnd_08.txt WA
01_rnd_09.txt WA
01_rnd_10.txt WA
01_rnd_11.txt WA
01_rnd_12.txt WA
01_rnd_13.txt WA
01_rnd_14.txt WA
01_rnd_15.txt WA
01_rnd_16.txt WA
01_rnd_17.txt WA
01_rnd_18.txt WA
01_rnd_19.txt WA