QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#74721#5006. HeximalXKError#WA 2ms3580kbC++14863b2023-02-03 15:28:172023-02-03 15:28:20

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-03 15:28:20]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3580kb
  • [2023-02-03 15:28:17]
  • 提交

answer

#include <bits/stdc++.h>

#define ll long long

using namespace std;

char s[5000005];

//long double log10(long double x) {
//	return log(x) / log(10);
//}

int main() {
	scanf("%s", s);
	int n = strlen(s);
//	cout<<n<<endl;
	if (n == 1 && s[0] == '0') return puts("1"), 0;
	ll res = 0;
	ll tmp = 0;
	ll ans = 0;
	if (n <= 18) {
		for (int i = 0; i < n; i++) res = res * 10 + s[i] - '0';
		ans = log((long double)res) / log(6) + 1;
//		printf("%d\n", ans);
	}
	else {
		for (int i = 0; i < 18; i++) res = res * 10 + s[i] - '0';
//		cout<<res<<" "<<n - 18<<" "<<log10((long double)res) + n - 18<<endl;
		ans = (log10((long double)res) + n - 18) / log10(6) + 1;
//		printf("%d\n", ans);
	}
	for (int i = 0; i < n; i++) tmp = (tmp * 10 + s[i] - '0') % 21936950640377856ll;
	if (tmp < 1e9) ++ans;
	printf("%d\n", ans);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3580kb

input:

0

output:

1

result:

ok single line: '1'

Test #2:

score: -100
Wrong Answer
time: 2ms
memory: 3524kb

input:

1865

output:

6

result:

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