Submission #9225

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
92252014-09-28 04:50:38coreaSolve another chuck (kriii2_S)C++14
0 / 4
0 ms1088 KiB
#include <stdio.h>
int a, b;
int main(){
scanf("%d%d", &a, &b);
int minabs = 2147483647;
int plus = 0, zero = 0, minus = 0;
int i, j;
long long sum = 0;
for(i = 0; i < a; i++){
for(j = 0; j < b; j++){
int x;
scanf("%d", &x);
int absx = x < 0 ? -x : x;
if(absx < minabs) minabs = x;
sum += absx;
if(x > 0) plus++;
else if(x == 0) zero++;
else minus++;
}
}
if(a % 2 == 1 || b % 2 == 1) printf("%lld 0\n", sum);
else printf("%lld 0\n", sum - 2 * minabs);
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...