QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#164182 | #4274. $2x + 2$ | raymond_7 | WA | 0ms | 1744kb | C++14 | 451b | 2023-09-04 20:33:48 | 2023-09-04 20:33:49 |
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(int i = n; 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: 1744kb
input:
4
output:
3
result:
ok answer is '3'
Test #2:
score: 0
Accepted
time: 0ms
memory: 1700kb
input:
10000000000
output:
6666666667
result:
ok answer is '6666666667'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 1600kb
input:
11537
output:
76812
result:
wrong answer expected '7692', found '76812'