Submission

Status:

[PPPP][PPPPPPPPPPP]

Subtask/Task Score:

{30/30}{70/70}

Score: 100

User: Kei

Problemset: ดูวีทูปเบอร์

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-11 08:23:51

#include<bits/stdc++.h>

using namespace std;
using ll = long long;
using vint = vector<int>;
using pii = pair<int,int>;
using vstr =vector<string>;
using ull = unsigned long long;
using mii = map<int,int>;

void solve(){
    //howmany days from d1m1 to d2m2 * 3
    // no leap case
    int d1,m1,d2,m2;
    int days=0;
    mii m={
        {0,0},
        {1,31},
        {2,59},
        {3,90},
        {4,120},
        {5,151},
        {6,181},
        {7,212},
        {8,243},
        {9,273},
        {10,304},
        {11,334},
        {12,365},
    };

    cin >>d1>>m1>>d2>>m2;
    days+=m[m2-1]+d2-m[m1-1]-d1+1;
    days*=3;
    cout<<days;

}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    solve();
    return 0;
}