| Task: | kusac |
| Sender: | zxc |
| Submission time: | 2016-07-27 14:17:03 +0300 |
| Language: | C++ |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| test | verdict | time | |
|---|---|---|---|
| #1 | WRONG ANSWER | 0.05 s | details |
| #2 | WRONG ANSWER | 0.06 s | details |
| #3 | RUNTIME ERROR | 0.05 s | details |
| #4 | RUNTIME ERROR | 0.04 s | details |
| #5 | RUNTIME ERROR | 0.05 s | details |
| #6 | WRONG ANSWER | 0.06 s | details |
| #7 | WRONG ANSWER | 0.05 s | details |
| #8 | WRONG ANSWER | 0.06 s | details |
| #9 | WRONG ANSWER | 0.06 s | details |
| #10 | WRONG ANSWER | 0.05 s | details |
| #11 | WRONG ANSWER | 0.06 s | details |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:15:9: warning: unused variable 'q' [-Wunused-variable]
int q = n/gcd;
^Code
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,m;
cin>>n>>m;
if(n % m == 0) {
cout<<0<<'\n';
return 1;
}
while(n > m) {
n -= m;
}
cout<<n<<' '<<m<<'\n';
int gcd = __gcd(n, m);
int q = n/gcd;
int w = m/gcd;
cout<<(w-1)*gcd<<'\n';
}
Test details
Test 1
Verdict: WRONG ANSWER
| input |
|---|
| 2 6 |
| correct output |
|---|
| 4 |
| user output |
|---|
| 2 6 4 |
Test 2
Verdict: WRONG ANSWER
| input |
|---|
| 3 4 |
| correct output |
|---|
| 3 |
| user output |
|---|
| 3 4 3 |
Test 3
Verdict: RUNTIME ERROR
| input |
|---|
| 6 2 |
| correct output |
|---|
| 0 |
| user output |
|---|
| 0 |
Test 4
Verdict: RUNTIME ERROR
| input |
|---|
| 7 7 |
| correct output |
|---|
| 0 |
| user output |
|---|
| 0 |
Test 5
Verdict: RUNTIME ERROR
| input |
|---|
| 15 5 |
| correct output |
|---|
| 0 |
| user output |
|---|
| 0 |
Test 6
Verdict: WRONG ANSWER
| input |
|---|
| 15 16 |
| correct output |
|---|
| 15 |
| user output |
|---|
| 15 16 15 |
Test 7
Verdict: WRONG ANSWER
| input |
|---|
| 10 90 |
| correct output |
|---|
| 80 |
| user output |
|---|
| 10 90 80 |
Test 8
Verdict: WRONG ANSWER
| input |
|---|
| 79 56 |
| correct output |
|---|
| 55 |
| user output |
|---|
| 23 56 55 |
Test 9
Verdict: WRONG ANSWER
| input |
|---|
| 39 26 |
| correct output |
|---|
| 13 |
| user output |
|---|
| 13 26 13 |
Test 10
Verdict: WRONG ANSWER
| input |
|---|
| 56 98 |
| correct output |
|---|
| 84 |
| user output |
|---|
| 56 98 84 |
Test 11
Verdict: WRONG ANSWER
| input |
|---|
| 90 54 |
| correct output |
|---|
| 36 |
| user output |
|---|
| 36 54 36 |
