Submission #2124598


Source Code Expand

#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define N 100010
int main()
{
    long long x,y,z;
    scanf("%lld%lld",&x,&y);
    if(x==y)
    {
        printf("-1\n");
        return 0;
    }
    for(long long i=2;i<=100000;i++)
    {
        z=x*i;
        if(z%y)
        {
            printf("%lld\n",z);
            return 0;
        }
    }
    printf("-1\n");
    return 0;
}

Submission Info

Submission Time
Task A - Two Integers
User yangshuang
Language C++14 (GCC 5.4.1)
Score 100
Code Size 439 Byte
Status AC
Exec Time 2 ms
Memory 128 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:9:28: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld%lld",&x,&y);
                            ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 14
Set Name Test Cases
Sample 0_000.txt, 0_001.txt
All 0_000.txt, 0_001.txt, 1_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt
Case Name Status Exec Time Memory
0_000.txt AC 1 ms 128 KB
0_001.txt AC 1 ms 128 KB
1_002.txt AC 1 ms 128 KB
1_003.txt AC 1 ms 128 KB
1_004.txt AC 2 ms 128 KB
1_005.txt AC 1 ms 128 KB
1_006.txt AC 1 ms 128 KB
1_007.txt AC 1 ms 128 KB
1_008.txt AC 2 ms 128 KB
1_009.txt AC 1 ms 128 KB
1_010.txt AC 2 ms 128 KB
1_011.txt AC 2 ms 128 KB
1_012.txt AC 1 ms 128 KB
1_013.txt AC 1 ms 128 KB
for_sample.txt AC 1 ms 128 KB