121672024-12-06 07:43:55andorasrÖntözés (50 pont)cpp11Accepted 50/5082ms708 KiB
#include <iostream>

using namespace std;

int main()
{
    int q,M,A,x,B,y,ido,sz;
    cin>>q;
    cin>>M;
    int a[q];
    for(int i=1;i<=q;i++)
    {
     cin>>A>>x>>B>>y;

     ido=(B-A)*24+y-x;//ennyi idoblokk
     if(ido%M==0)sz=ido/M-1;
        else sz=ido/M;
     a[i]=sz;
    }
    for(int i=1;i<=q;i++)
    cout<<a[i]<<endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/01ms500 KiB
2Accepted0/012ms320 KiB
3Accepted5/51ms320 KiB
4Accepted5/572ms568 KiB
5Accepted3/31ms500 KiB
6Accepted3/31ms320 KiB
7Accepted3/31ms320 KiB
8Accepted3/31ms320 KiB
9Accepted3/31ms508 KiB
10Accepted3/31ms320 KiB
11Accepted3/31ms320 KiB
12Accepted1/11ms528 KiB
13Accepted1/11ms324 KiB
14Accepted1/11ms320 KiB
15Accepted1/11ms324 KiB
16Accepted2/279ms700 KiB
17Accepted3/382ms708 KiB
18Accepted2/282ms472 KiB
19Accepted3/375ms460 KiB
20Accepted1/182ms480 KiB
21Accepted1/178ms680 KiB
22Accepted3/382ms568 KiB