QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#818650#9864. CoinzhouyidieWA 0ms3688kbC++14727b2024-12-18 00:53:282024-12-18 00:53:29

Judging History

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

  • [2024-12-18 00:53:29]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3688kb
  • [2024-12-18 00:53:28]
  • 提交

answer

#include<bits/stdc++.h>
#define LL long long

using namespace std;
const int N=1e5+100;
int n,q;
LL a[N];
map<LL,LL> mp ;
void solve(){
    cin >> n >> q ;
    mp.clear() ;
    for (int i = 1 ; i <= n ; i ++ ) {
        cin >> a[i];
    }
    a[n+1] = a[n]+1;
    for (LL i = 1 ; i < n ; i++ ) {
        LL lt = (i) , rt = n-i;
        mp[(LL)(i*(n-i))] += a[i+1] - a[i];
        if(i ==n-1) mp[(LL)(i*(n-i))] += 1;

    }
    for (int i = 1 ; i <= q; i ++ ) {
        LL x ; cin >> x ;
        cout << mp[x] << " " ;
    }
    cout  << '\n';
}
int main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int T=1;
    cin>>T;
    while(T--){
        solve();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3688kb

input:

4
6 2
8 3
10000 2
1919810 114514

output:

0 0 
0 0 
0 0 
0 0 

result:

wrong answer 1st numbers differ - expected: '4', found: '0'