QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#164194#4274. $2x + 2$raymond_7WA 0ms1816kbC++14532b2023-09-04 20:37:132023-09-04 20:37:13

Judging History

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

  • [2023-09-04 20:37:13]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:1816kb
  • [2023-09-04 20:37:13]
  • 提交

answer

#include <cstdio>
#include <cstring>
#define For(i, l, r) for(int i = l; i <= r; i ++)

using namespace std;

const int N = 110;

int n, a[N];
char s[N];

int main()
{
	scanf("%s", s + 1); n = strlen(s + 1);
	For(i, 1, n) a[i] = (s[n - i + 1] - '0') * 2;
	a[1] += 2;
	a[0] = n;
	For(i, 1, n + 1) a[i + 1] += a[i] / 10, a[i] %= 10;
	if(a[n + 1]) a[0] ++;
	for(int i = a[0]; i ; i --)
	{
		a[i - 1] += a[i] % 3 * 10;
		a[i] /= 3;
	}
	while(!a[a[0]]) a[0] --;
	For(i, 1, a[0]) printf("%d", a[a[0] - i + 1]);
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 1688kb

input:

4

output:

3

result:

ok answer is '3'

Test #2:

score: 0
Accepted
time: 0ms
memory: 1584kb

input:

10000000000

output:

6666666667

result:

ok answer is '6666666667'

Test #3:

score: 0
Accepted
time: 0ms
memory: 1692kb

input:

11537

output:

7692

result:

ok answer is '7692'

Test #4:

score: 0
Accepted
time: 0ms
memory: 1816kb

input:

41309

output:

27540

result:

ok answer is '27540'

Test #5:

score: -100
Wrong Answer
time: 0ms
memory: 1584kb

input:

8191927142339937565554845978095081242540169480073285738552305926582959325059543812213073905385467089

output:

1000000000005461284761559958377036563985396720828360112986715523825701537284388639550039695874808715936923644726

result:

wrong answer expected '546128476155995837703656398539...9550039695874808715936923644727', found '100000000000546128476155995837...9550039695874808715936923644726'