Submission #171724


Source Code Expand

Copy
#include <cstdio>
#include <vector>
#include <cstring>
#include <functional>
#include <algorithm>
#include <math.h>
#include <bitset>
#include <set>
#include <queue>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <complex>
#include <numeric>
#include <map>
#include <time.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;
typedef pair<int,pii> pip;
typedef pair<pii,int> ppi;
typedef pair<pii,pii> ppp;
typedef pair<ll,ll> pll;
typedef pair<double,int> pdi;
typedef pair<double,double> pdd;
typedef vector<double> vec;
typedef vector<vec> mat;
#define rep(i,n) for (int (i) = 0; (i) < (n); (i)++)
#define repn(i,a,n) for (int (i) = (a); (i) < (n); (i)++)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back
#define SORT(x) sort((x).begin(),(x).end())
#define SORTN(x,n) sort((x),(x)+(n))
#define ERASE(x) (x).erase(unique((x).begin(),(x).end()),(x).end())
#define COUNT(x,c) count((x).begin(),(x).end(),(c))
#define REMOVE(x,c) (x).erase(remove((x).begin(),(x).end(),(c)),(x).end())
#define REVERSE(x) reverse((x).begin(),(x).end())
#define FORIT(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))-(x).begin()
#define lb(x,a) lower_bound((x).begin(),(x).end(),(a))
#define LBN(x,a,n) lower_bound((x),(x)+(n),(a))-(x)
#define lbN(x,a,n) lower_bound((x),(x)+(n),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))-(x).begin()
#define ub(x,a) upper_bound((x).begin(),(x).end(),(a))
#define BS(x,a) binary_search((x).begin(),(x).end(),(a))
#define BS2(x,n,a) binary_search((x),(x)+(n),(a))
#define NB(x) (((x)&~((x)+((x)&-(x))))/((x)&-(x))>>1)|((x)+((x)&-(x)))
#define NP(x) next_permutation((x).begin(),(x).end())
#define MM(x,p) memset((x),(p),sizeof(x))
#define SQ(x) (x)*(x)
#define SC(c1,c2) strcmp(c1,c2)==0
#define mp make_pair
#define INF (1<<29)
#define INFL (1LL<<50)
#define fi first
#define se second
#define MOD 1000000007
#define EPS 1e-8

ll Y,M,D;

ll calc(ll y,ll m, ll d)
{
	ll res=0;
	res+=365*y;
	res+=y/4;
	res-=y/100;
	res+=y/400;
	res+=306*(m+1)/10;
	res+=d;
	res-=429;
	return res;
}

int main()
{
	scanf("%lld%lld%lld",&Y,&M,&D);
	if(M<=2)Y--,M+=12;
	ll cc=calc(Y,M,D);
	printf("%lld\n",calc(2014,5,17)-cc);
}

Submission Info

Submission Time
Task A - 経過日数
User namonakiacc
Language C++ (G++ 4.6.4)
Score 100
Code Size 2470 Byte
Status AC
Exec Time 23 ms
Memory 916 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:82:32: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 4
AC × 24
Set Name Test Cases
Sample subtask0_sample01.txt, subtask0_sample02.txt, subtask0_sample03.txt, subtask0_sample04.txt
All subtask0_sample01.txt, subtask0_sample02.txt, subtask0_sample03.txt, subtask0_sample04.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_20.txt
Case Name Status Exec Time Memory
subtask0_sample01.txt AC 23 ms 808 KB
subtask0_sample02.txt AC 22 ms 796 KB
subtask0_sample03.txt AC 21 ms 788 KB
subtask0_sample04.txt AC 21 ms 792 KB
subtask1_01.txt AC 23 ms 792 KB
subtask1_02.txt AC 22 ms 912 KB
subtask1_03.txt AC 23 ms 808 KB
subtask1_04.txt AC 22 ms 896 KB
subtask1_05.txt AC 23 ms 800 KB
subtask1_06.txt AC 21 ms 796 KB
subtask1_07.txt AC 22 ms 916 KB
subtask1_08.txt AC 21 ms 796 KB
subtask1_09.txt AC 21 ms 792 KB
subtask1_10.txt AC 21 ms 792 KB
subtask1_11.txt AC 21 ms 912 KB
subtask1_12.txt AC 19 ms 792 KB
subtask1_13.txt AC 22 ms 788 KB
subtask1_14.txt AC 22 ms 788 KB
subtask1_15.txt AC 22 ms 796 KB
subtask1_16.txt AC 19 ms 792 KB
subtask1_17.txt AC 22 ms 808 KB
subtask1_18.txt AC 19 ms 788 KB
subtask1_19.txt AC 19 ms 908 KB
subtask1_20.txt AC 20 ms 844 KB