QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#605686 | #9107. Zayin and Count | jiangzhihui# | WA | 9ms | 3880kb | C++14 | 2.4kb | 2024-10-02 18:36:24 | 2024-10-02 18:36:25 |
Judging History
answer
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <unordered_map>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <stack>
#include <set>
#include <bitset>
#include <deque>
#include <bits/stdc++.h>
using namespace std ;
#define ios ios::sync_with_stdio(false) , cin.tie(0)
#define x first
#define y second
#define pb push_back
#define ls rt << 1
#define rs rt << 1 | 1
typedef long long ll ;
const double esp = 1e-6 , pi = acos(-1) ;
typedef pair<int , int> PII ;
const int N = 1e6 + 10 , INF = 0x3f3f3f3f , mod = 1e9 + 7;
int a[2][11] , c[100] , cnt ;
__int128 dp[1100][2] ;
void print(__int128 x) {
vector<int> v ;
while(x) v.push_back(x % 10) , x /= 10 ;
if(v.size() == 0) v.push_back(0) ;
reverse(v.begin() , v.end()) ;
for(auto x : v)
printf("%d" , x) ;
printf("\n") ;
}
__int128 dfs(int u , int flag , int limit , int t) {
if(u == 0) return flag == 0 ;
if(!limit && dp[u][flag] != -1) return dp[u][flag] ;
int end = limit ? c[u] : 9 ;
__int128 ans = 0 ;
for(int i = 0 ;i <= end; i ++ )
if(a[t][i]) ans += dfs(u - 1 , flag && i == 0 , limit && end == i , t) ;
if(!limit) dp[u][flag] = ans ;
return ans ;
}
__int128 solve(string x , int t) {
cnt = 0 ;
for(int i = x.size() - 1; i >= 0 ;i -- ) c[++ cnt] = x[i] - '0' ;
return dfs(cnt , 1 , 1 , t) + a[t][0] ;
}
__int128 in() {
__int128 x = 0 ;
char ch = getchar() ;
while(ch < '0' || ch > '9') ch = getchar() ;
while(ch >= '0' && ch <= '9') x = x * 10 + ch - 48 , ch = getchar() ;
return x ;
}
__int128 qmi(__int128 a , __int128 b) {
__int128 res = 1 ;
while(b) {
if(b & 1) res = res * a ;
a = a * a ;
b >>= 1 ;
}
return res ;
}
__int128 t[N] ;
int work()
{
__int128 q = 0 , cnt1 = 0 ;
for(int i = 0; i < 10 ;i ++ ) cin >> a[0][i] , cnt1 += a[0][i] ;
vector<int> b ;
for(int i = 0 ;i < 10 ;i ++ )
{
cin >> a[1][i] , q += a[1][i];
if(a[1][i]==1)b.push_back(i);
}
assert(!b.empty()) ;
string x ;
cin >> x ;
return 0 ;
}
int main()
{
// freopen("C://Users//spnooyseed//Desktop//in.txt" , "r" , stdin) ;
// freopen("C://Users//spnooyseed//Desktop//out.txt" , "w" , stdout) ;
int n ;
ios ;
cin >> n ;
while(n --)
work() ;
return 0 ;
}
/*
*/
詳細信息
Test #1:
score: 0
Wrong Answer
time: 9ms
memory: 3880kb
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:
result:
wrong answer 1st lines differ - expected: '52755244567262766742575722', found: ''