QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#164194 | #4274. $2x + 2$ | raymond_7 | WA | 0ms | 1816kb | C++14 | 532b | 2023-09-04 20:37:13 | 2023-09-04 20:37:13 |
Judging History
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]);
}
详细
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'