QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#250218 | #2291. Lopsided Lineup | Fyind | WA | 1ms | 3420kb | C++17 | 627b | 2023-11-12 23:08:07 | 2023-11-12 23:08:07 |
Judging History
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;
}
Details
Tip: Click on the bar to expand more detailed information
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'