QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#96426 | #5154. ETA | Sa3tElSefr# | WA | 10ms | 3692kb | C++14 | 2.0kb | 2023-04-13 21:20:49 | 2023-04-13 21:20:50 |
Judging History
answer
///Etfsh5t nseet el rank
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define F first
#define S second
#define f(i, a, b) for (int i = a; i < b; i++)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define sz(x) (int)(x).size()
#define mp(x, y) make_pair(x, y)
#define popCnt(x) (__builtin_popcountll(x))
#define int ll
using ll = long long;
using ull = unsigned long long;
using uint = uint32_t;
using ii = pair<int, int>;
const int N = 2e5 + 5, A = 12, LG = 18, MOD = (119 << 23) + 1;
const long double PI = acos(-1);
const long double EPS = 1e-9;
const int INF = 1e18;
string str = string(5000, '0');
const int MX = 100;
void doWork()
{
int a, b;
scanf("%d/%d", &a, &b);
for (int n = 1; n <= 1000000; n++)
{
///a/b = sum/n
if ((a * n) % b == 0)
{
int sum = a * n / b;
if (sum <= n * (n - 1) / 2 && sum >= (n - 1))
{
cout << n << ' ' << n - 1 << endl;
int cur = 2;
sum -= (n - 1);
while (sum >= (cur - 2))
{
sum -= (cur - 2);
cout << cur - 1 << ' ' << cur << '\n';
cur += 1;
}
for (int i = cur; i >= 0; --i)
{
while (sum >= i && cur <= n)
{
cout << i + 1 << ' ' << cur << '\n';
cur += 1;
sum -= i;
}
}
return;
}
}
}
cout << "impossible\n";
}
int32_t main()
{
#ifdef ONLINE_JUDGE
ios_base::sync_with_stdio(0);
cin.tie(0);
#endif // ONLINE_JUDGE
int t = 1;
// cin >> t;
while (t--)
{
doWork();
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 10ms
memory: 3692kb
input:
1/2
output:
impossible
result:
wrong output format Expected integer, but "impossible" found