QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#96421 | #5154. ETA | Sa3tElSefr# | WA | 2ms | 3728kb | C++14 | 2.4kb | 2023-04-13 21:16:59 | 2023-04-13 21:17:01 |
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');
int ptr = 0;
bool ask(string x)
{
if (x == "left")
{
ptr = (ptr + str.size() - 1) % str.size();
return str[ptr] - '0';
}
if (x == "right")
{
ptr = (ptr + 1) % str.size();
return str[ptr] - '0';
}
if (x == "flip")
{
str[ptr] ^= 1;
return str[ptr] - '0';
}
cout << "? " << x << endl;
bool ret;
cin >> ret;
return ret;
}
const int MX = 100;
void doWork()
{
int a, b;
scanf("%d/%d", &a, &b);
for (int n = 1; n <= 10; 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: 100
Accepted
time: 2ms
memory: 3728kb
input:
1/2
output:
2 1 1 2
result:
ok
Test #2:
score: 0
Accepted
time: 2ms
memory: 3448kb
input:
1/3
output:
impossible
result:
ok
Test #3:
score: -100
Wrong Answer
time: 2ms
memory: 3688kb
input:
7/4
output:
8 7 1 2 2 3 3 4 4 5 2 6 1 7
result:
wrong output format Unexpected end of file - int32 expected