QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#250218#2291. Lopsided LineupFyindWA 1ms3420kbC++17627b2023-11-12 23:08:072023-11-12 23:08:07

Judging History

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

  • [2023-11-12 23:08:07]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3420kb
  • [2023-11-12 23:08:07]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define debug(x) cout<<#x<<':'<<x<<endl;
typedef long long ll;
typedef pair<ll,ll> pii;
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector<ll> a(n + 1);
    for (int i = 1; i <= n; ++i) {
        int x;
        for (int j = 1; j <= n; ++j)
            cin >> x, a[i] += x;
    } 
    sort(a.begin() + 1, a.end());
    ll sum1 = 0, sum2 = 0;
    for (int i = 1; i <= n / 2; ++i)
        sum1 += a[i];
    for (int i = 1; i <= n / 2 + 1; ++i)
        sum2 += a[i];
    cout << sum2 - sum1 << '\n';
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3420kb

input:

20
0 786505 911962 -800624 363821 -960995 -492637 -246590 140762 54707 -353306 -82216 -175650 567363 113374 761152 906126 -394096 -635055 675627
786505 0 801116 -323471 -34197 -860051 865281 737621 307515 -493253 -128788 -171663 -21931 853897 -505337 72985 941995 -380960 -223577 265322
911962 801116...

output:

-604299

result:

wrong answer 1st lines differ - expected: '21235600', found: '-604299'