| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 441299 | 方相宜 | [ 2022年绍兴市第二十届少儿信息学竞赛复赛 ] - 分组(group) | C++ | Accepted | 100 | 6 MS | 240 KB | 564 | 2026-05-17 20:15:43 |
#include <iostream> using namespace std; int main() { int n, x, y; cin >> n >> x >> y; // 输入三个数 bool found = false; // a 从 0 开始遍历,保证 a 最小 for (int a = 0; a * x <= n; a++) { int remain = n - a * x; if (remain % y == 0) { // 剩下的能被 y 整除 int b = remain / y; cout << a << " " << b << endl; found = true; break; } } if (!found) { cout << "Impossible" << endl; } return 0; }