QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#194909#3853. Lines in a gridrealcomplex0#WA 33ms42744kbC++20668b2023-09-30 23:32:102023-09-30 23:32:11

Judging History

你现在查看的是最新测评结果

  • [2023-09-30 23:32:11]
  • 评测
  • 测评结果:WA
  • 用时:33ms
  • 内存:42744kb
  • [2023-09-30 23:32:10]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pii;
typedef long double ld;

#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const int N = (int)1e7 + 10;
const int MOD = (int)1e6 + 3;

int res[N];

int main(){
    fastIO;
    res[1] = 0;
    res[2] = 6;
    for(int i = 3; i < N;  i ++ ){
        res[i] = (res[i - 1] +  ((3 * i - 2) * 1ll * (i - 1)) % MOD) % MOD;
    }
    int q;
    cin >> q;
    int l;
    for(int i = 1; i <= q; i ++ ){
        cin >> l;
        cout << res[l] << "\n";
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 33ms
memory: 42744kb

input:

10
1 2 3 4 5 6 7 8 9 10

output:

0
6
20
50
102
182
296
450
650
902

result:

wrong answer 4th lines differ - expected: '62', found: '50'