QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#194907#3853. Lines in a gridrealcomplex0#WA 9ms42480kbC++14662b2023-09-30 23:30:572023-09-30 23:30:57

Judging History

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

  • [2023-09-30 23:30:57]
  • 评测
  • 测评结果:WA
  • 用时:9ms
  • 内存:42480kb
  • [2023-09-30 23:30:57]
  • 提交

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);
    }
    int q;
    cin >> q;
    int l;
    for(int i = 1; i <= q; i ++ ){
        cin >> l;
        cout << res[l] << "\n";
    }
    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 9ms
memory: 42480kb

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'