QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#494061 | #5006. Heximal | Railgun2334 | WA | 1ms | 5168kb | C++14 | 1.7kb | 2024-07-27 13:56:55 | 2024-07-27 13:56:55 |
Judging History
answer
#include<bits/stdc++.h>
//#define int long long
#define endl "\n"
#define PII std::pair<int,int>
#define ll long long
#define inf 0x3f3f3f3f
using namespace std;
const int maxn = 100005;
struct big {
int a[maxn], len;
bool flag = false;
big(const int aa = 0) {
memset(a, 0, sizeof(int) * 1000);
a[1] = aa;
len = 1;
}
friend bool operator < (big b1, big b2) {
int l = max(b1.len, b2.len);
for (int i = l; i > 0; --i) {
if (b1.a[i] != b2.a[i]) return b1.a[i] < b2.a[i];
}
return false;
}
friend big operator * (big b1, ll a) {
ll yu = 0, i;
for (i = 1; i <= b1.len || yu != 0; ++i) {
b1.a[i] = b1.a[i] * a + yu;
yu = b1.a[i] / 10;
b1.a[i] %= 10;
}
while (b1.a[i] == 0 && i > 1) i--;
b1.len = i;
return b1;
}
friend ostream& operator << (ostream& o, big b) {
if (b.flag) o << '-';
for (int i = b.len; i > 0; --i) {
o << b.a[i];
}
return o;
}
friend istream& operator >> (istream& i, big& b) {
string s; i >> s;
reverse(s.begin(), s.end());
for (int i = 1; i <= s.size(); ++i) {
b.a[i] = s[i - 1] - '0';
}
b.len = s.size();
return i;
}
};
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(0);
//cout << fixed << setprecision(2);
big b1; cin >> b1;
big b2 = 1;
for (int i = 0; i < maxn; ++i) {
if (b1 < b2) {
cout << i << endl;
return 0;
}
b2 = b2 * 6;
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 5168kb
input:
0
output:
0
result:
wrong answer 1st lines differ - expected: '1', found: '0'