Wrong Answer
Code
#include <iostream>
#include <iomanip>
int main() {
int G;
std::cin >> G;
for (int i = 0; i < G; ++i) {
int A, U;
std::cin >> A >> U;
if (A == 0) {
std::cout << "Game #" << i + 1 << ": 0 / 1" << std::endl;
continue;
}
int gcd = 1;
for (int j = 1; j <= U; ++j) {
if (A % j == 0 && U % j == 0) {
gcd = j;
}
}
int numerator = U / gcd;
int denominator = A / gcd;
std::cout << "Game #" << i + 1 << ": " << numerator << " / " << denominator << std::endl;
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1001 Achievement-Unlocked
- Language
- C++20 (G++ 13.2.0)
- Submit At
- 2024-03-06 13:16:53
- Judged At
- 2024-11-11 03:42:42
- Judged By
- Score
- 0
- Total Time
- 1ms
- Peak Memory
- 532.0 KiB