QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#374453#3722. 2017秦始皇派蒙恬还原神舟十二 (Jiancong Wen, Chu Jin, Zekai Zhang)AC ✓2ms3888kbC++17449b2024-04-02 14:21:262024-04-02 14:21:26

Judging History

This is the latest submission verdict.

  • [2024-04-02 14:21:26]
  • Judged
  • Verdict: AC
  • Time: 2ms
  • Memory: 3888kb
  • [2024-04-02 14:21:26]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{

    int a, b, c, d;
    while (scanf("%lld%lld%lld%lld", &a, &b, &c, &d) != EOF)
    {
        int nb = b / 2017, na = (a - 1) / 2017, nc = (c - 1) / 2017, nd = d / 2017;
    
        int nx = nb - na, ny = nd - nc;
        int ans = nx *(d - c + 1) + ny * (b - a + 1) - (nx * ny);
        printf("%lld\n",ans);
        // cout << ans <<"\n"; 
    }
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 3888kb

input:

657566422 885255954 448993422 666465506
458282444 756101506 350414894 783903861
780975914 902703074 453374141 986255693
94558083 121905007 7212181 480096950
110322930 812575433 244899505 686704831
226538966 341149232 102321875 194809116
553489234 741264907 599873654 776794417
477987278 619201381 453...

output:

49086650502585
127981757234584
64303697473053
12819679604810
307567863166426
10508043731954
32933192774614
45732157630992
24864680661036
35204017360992
132954385494629
178059940617418
211646726664373
8366935398060
47338241946190
116610929800533
181437148566555
17267342947320
150774601552882
50733758...

result:

ok 10000 numbers