Submission #19425053


Source Code Expand

Copy
#include<bits/stdc++.h>
#include<atcoder/all>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 100001
#define i197 1000000007

using namespace std;
using namespace atcoder;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<ll,int> Pli;
typedef pair<Pi,Pi> Pi2;
typedef pair<P1,ll>P2;
const ll INF=1000000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};
struct pos{
	// 1 変数を入れる;
	int t,x,y;
};


int main(){

	ll a,b;
	cin>>a>>b;
	ll ans=0;
	if(a%4==0)ans+=(b-a)/4+1;
	else if(a+4-a%4<=b)ans+=(b-(a+4-a%4))/4+1;
	if(a%100==0)ans-=(b-a)/100+1;
	else if(a+100-a%100<=b)ans-=(b-(a+100-a%100))/100+1;
	if(a%400==0)ans+=(b-a)/400+1;
	else if(a+400-a%400<=b)ans+=(b-(a+400-a%400))/400+1;
	cout<<ans<<endl;

	return 0;

}

Submission Info

Submission Time
Task C - 2月29日
User akarinkof
Language C++ (GCC 9.2.1)
Score 100
Code Size 997 Byte
Status AC
Exec Time 9 ms
Memory 3620 KB

Judge Result

Set Name sub All
Score / Max Score 25 / 25 75 / 75
Status
AC × 10
AC × 22
Set Name Test Cases
sub test_01A.txt, test_02A.txt, test_03A.txt, test_04A.txt, test_05A.txt, test_07A.txt, test_09A.txt, test_11A.txt, test_13A.txt, test_15A.txt
All sample_01.txt, sample_02.txt, sample_03.txt, test_01A.txt, test_02A.txt, test_03A.txt, test_04A.txt, test_05A.txt, test_06.txt, test_07A.txt, test_08.txt, test_09A.txt, test_10.txt, test_11A.txt, test_12.txt, test_13A.txt, test_14.txt, test_15A.txt, test_16.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
sample_01.txt AC 9 ms 3384 KB
sample_02.txt AC 2 ms 3588 KB
sample_03.txt AC 2 ms 3516 KB
test_01A.txt AC 3 ms 3540 KB
test_02A.txt AC 2 ms 3448 KB
test_03A.txt AC 2 ms 3584 KB
test_04A.txt AC 4 ms 3452 KB
test_05A.txt AC 2 ms 3620 KB
test_06.txt AC 2 ms 3436 KB
test_07A.txt AC 2 ms 3472 KB
test_08.txt AC 3 ms 3592 KB
test_09A.txt AC 2 ms 3400 KB
test_10.txt AC 2 ms 3592 KB
test_11A.txt AC 2 ms 3452 KB
test_12.txt AC 2 ms 3580 KB
test_13A.txt AC 2 ms 3548 KB
test_14.txt AC 2 ms 3544 KB
test_15A.txt AC 2 ms 3456 KB
test_16.txt AC 2 ms 3564 KB