QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#735346 | #7049. Base62 | gyydp123_LIM | AC ✓ | 1ms | 3908kb | C++20 | 1.3kb | 2024-11-11 19:23:27 | 2024-11-11 19:23:27 |
Judging History
answer
//Start: 2024-11-11 19:15:48
#include<bits/stdc++.h>
#define For(i,j,k) for(int i=(j);i<=(k);++i)
#define ForDown(i,j,k) for(int i=(j);i>=(k);--i)
#define Debug(fmt, args...) fprintf(stderr,"(func %s, line #%d): " fmt, __func__, __LINE__, ##args),fflush(stderr)
#define debug(fmt, args...) fprintf(stderr,fmt,##args),fflush(stderr)
#define within :
#define LJY main
using namespace std;
typedef long long ll;
const int N=1505;
mt19937 rnd(chrono::system_clock::now().time_since_epoch().count());
inline int read(){
char ch=getchar();int x=0,f=1;
while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();}
while(ch>='0'&&ch<='9')
x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
return x*f;
}
int a[N],b[N],tot,c[N],x,y;
char s[N];
char itoc(int x){
if(x<10) return x+'0';
else if(x<36) return x-10+'A';
else return x-36+'a';
}
int ctoi(char x){
if(x>='0'&&x<='9') return x-48;
else if(x>='A'&&x<='Z') return x-'A'+10;
else return x-'a'+36;
}
signed LJY(){
x=read();y=read();scanf("%s",s+1);
int len=strlen(s+1);
For(i,1,len) a[i]=ctoi(s[i]);
reverse(a+1,a+1+len);
while(len){
For(i,1,len) c[i]=0;
int now=0;
ForDown(i,len,1){
now=now*x+a[i];
c[i]=now/y;now%=y;
}b[++tot]=now;
while(len&&!c[len]) len--;
For(i,1,len) a[i]=c[i];
}ForDown(i,tot,1) putchar(itoc(b[i]));
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3836kb
input:
16 2 FB
output:
11111011
result:
ok single line: '11111011'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
62 2 abcdefghiz
output:
11011100000100010111110010010110011111001001100011010010001
result:
ok single line: '11011100000100010111110010010110011111001001100011010010001'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
10 16 1234567890123456789012345678901234567890
output:
3A0C92075C0DBF3B8ACBC5F96CE3F0AD2
result:
ok single line: '3A0C92075C0DBF3B8ACBC5F96CE3F0AD2'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
16 35 3A0C92075C0DBF3B8ACBC5F96CE3F0AD2
output:
333YMHOUE8JPLT7OX6K9FYCQ8A
result:
ok single line: '333YMHOUE8JPLT7OX6K9FYCQ8A'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
35 23 333YMHOUE8JPLT7OX6K9FYCQ8A
output:
946B9AA02MI37E3D3MMJ4G7BL2F05
result:
ok single line: '946B9AA02MI37E3D3MMJ4G7BL2F05'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
23 49 946B9AA02MI37E3D3MMJ4G7BL2F05
output:
1VbDkSIMJL3JjRgAdlUfcaWj
result:
ok single line: '1VbDkSIMJL3JjRgAdlUfcaWj'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
61 5 dl9MDSWqwHjDnToKcsWE1S
output:
42104444441001414401221302402201233340311104212022133030
result:
ok single line: '42104444441001414401221302402201233340311104212022133030'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
5 10 42104444441001414401221302402201233340311104212022133030
output:
1234567890123456789012345678901234567890
result:
ok single line: '1234567890123456789012345678901234567890'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
62 10 123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
output:
361097996547231939420324315862125604148156665886431480862914942937732101183106158332978897913678986703118641
result:
ok single line: '361097996547231939420324315862...6158332978897913678986703118641'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
10 62 361097996547231939420324315862125604148156665886431480862914942937732101183106158332978897913678986703118641
output:
123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
result:
ok single line: '123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3908kb
input:
62 2 1000000000000
output:
101011101110010101110010000011101110100000110000011010000001000000000000
result:
ok single line: '101011101110010101110010000011...0110000011010000001000000000000'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
62 2 0
output:
0
result:
ok single line: '0'
Test #13:
score: 0
Accepted
time: 1ms
memory: 3864kb
input:
62 2 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
output:
101101010111011101011010100010010111100101010100101110001000001101101111000000111101111101011101101111010000100001111110100110110110001101010010101000000011010000100100110101000110110010001110001011001111001100001101010010001111001100110100110110111101001010111100010010011111110111111000010011110010...
result:
ok single line: '101101010111011101011010100010...1111111111111111111111111111111'