QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#504721 | #9107. Zayin and Count | Lavender_Field# | WA | 3ms | 3684kb | C++20 | 1.4kb | 2024-08-04 15:21:27 | 2024-08-04 15:21:28 |
Judging History
answer
#include<bits/stdc++.h>
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define ROF(i,a,b) for(int i=a;i>=b;i--)
#define fi first
#define se second
#define pb push_back
#define Mp make_pair
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int rd() {
int r = 0; bool w = false; char ch = getchar();
while( ch < '0' || ch > '9' ) w = !(ch^45), ch = getchar();
while( ch >= '0' && ch <= '9' ) r = (r<<1) + (r<<3) + (ch^48), ch = getchar();
return w ? -r : r;
}
ll rdl() {
ll r = 0; bool w = false; char ch = getchar();
while( ch < '0' || ch > '9' ) w = !(ch^45), ch = getchar();
while( ch >= '0' && ch <= '9' ) r = (r<<1) + (r<<3) + (ch^48), ch = getchar();
return w ? -r : r;
}
#define MAXL 100
char s[MAXL];
int avis[MAXL], bvis[MAXL];
int bnum[MAXL], bcnt, acnt;
int st[MAXL];
void solve() {
acnt = 0; FOR(i,0,9) avis[i] = rd(), acnt += avis[i];
bcnt = 0;
FOR(i,0,9) {
bvis[i] = rd();
if( bvis[i] ) bnum[++bcnt] = i;
}
FOR(i,1,9) avis[i] += avis[i-1];
scanf("%s", s+1);
int l = strlen(s+1);
__int128 mul = 1;
__int128 x = 0;
FOR(i,1,l){
x=x*(__int128)acnt;
x+=(avis[s[i] - '0'] - 1);
}
st[0] = 0;
if( x == 0 ) st[st[0] = 1] = 0;
while( x ) st[++st[0]] = x%(__int128)bcnt, x/=(__int128)bcnt;
ROF(i,st[0],1) putchar('0' + bnum[st[i] + 1]); putchar('\n');
return;
}
int main() {
int T = rd(); while( T-- ) solve();
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 3ms
memory: 3684kb
input:
10000 1 0 0 0 1 1 0 0 0 1 0 0 1 0 1 1 1 1 0 0 950595954440050004054505054050 1 0 0 0 1 1 1 1 0 0 1 1 1 0 1 0 0 0 1 1 45467007076660767550460064 1 1 1 1 0 0 0 1 0 0 1 1 0 1 1 0 1 0 0 1 23373171320213300170200722 0 0 0 0 1 1 1 0 1 0 0 0 1 0 0 1 0 1 1 1 558565664666565565558468668484 1 1 0 0 1 0 1 0 1 ...
output:
65266455722475422254727242 41990991999414091249949 101364364636933104003903 57259252998225997772927975 878555885282288227752558252252 610010606760761011770006661017 68888858668556558688868865568855558868 51566165566155616511615666156611165656 505885888775005550558080707878 3333916221911699323366319 ...
result:
wrong answer 1st lines differ - expected: '52755244567262766742575722', found: '65266455722475422254727242'