Wrong Answer
Code
#include <iostream>
#include <iomanip>
int main() {
int G; // Number of games
std::cin >> G;
for (int i = 0; i < G; ++i) {
int A, U; // Number of achievements available and unlocked
std::cin >> A >> U;
// Calculate percentage and find irreducible fraction
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 << numerator << " / " << denominator << std::endl;
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1001 Achievement-Unlocked
- Language
- C++11 (G++ 13.2.0)
- Submit At
- 2024-03-06 13:09:22
- Judged At
- 2024-11-11 03:42:50
- Judged By
- Score
- 0
- Total Time
- 1ms
- Peak Memory
- 764.0 KiB