Submission #1041206


Source Code Expand

#include<stdio.h>
#include<math.h>
main()
{
    int a,b,ans;
    scanf("%d%d",&a,&b);
    ans = fabs(fabs(a)-fabs(b));
    if(a<0 && b<0) ans += 2;
    else if(a<0 || b<0) ans += 1;
    printf("%d",ans);
}

Submission Info

Submission Time
Task A - Simple Calculator
User Top34051
Language C++14 (GCC 5.4.1)
Score 0
Code Size 217 Byte
Status WA
Exec Time 1 ms
Memory 128 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:6:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&a,&b);
                        ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
AC × 10
WA × 4
Set Name Test Cases
Sample 0_00.txt, 0_01.txt, 0_02.txt
All 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt
Case Name Status Exec Time Memory
0_00.txt AC 1 ms 128 KB
0_01.txt AC 1 ms 128 KB
0_02.txt AC 1 ms 128 KB
1_00.txt AC 1 ms 128 KB
1_01.txt AC 1 ms 128 KB
1_02.txt AC 1 ms 128 KB
1_03.txt WA 1 ms 128 KB
1_04.txt WA 1 ms 128 KB
1_05.txt WA 1 ms 128 KB
1_06.txt AC 1 ms 128 KB
1_07.txt AC 1 ms 128 KB
1_08.txt AC 1 ms 128 KB
1_09.txt AC 1 ms 128 KB
1_10.txt WA 1 ms 128 KB