QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#194907 | #3853. Lines in a grid | realcomplex0# | WA | 9ms | 42480kb | C++14 | 662b | 2023-09-30 23:30:57 | 2023-09-30 23:30:57 |
Judging History
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'