QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#494061#5006. HeximalRailgun2334WA 1ms5168kbC++141.7kb2024-07-27 13:56:552024-07-27 13:56:55

Judging History

你现在查看的是最新测评结果

  • [2024-07-27 13:56:55]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:5168kb
  • [2024-07-27 13:56:55]
  • 提交

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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 5168kb

input:

0

output:

0

result:

wrong answer 1st lines differ - expected: '1', found: '0'