int main{pw[0] = 1;for(int i = 1;i<=13;++i)pw[i] =pw[i-1]*3;scanf("%d",&n);scanf("%s",str+1);now=0;for(inti=1;i<=pw[n];++i){a[now][i] =str[i]=='1';f[now][i] =1;}for(inti=n;i>= 1;--i){// 原来在第i层,现在要到第i-1层for(int j = 1;j ...
We will hold AtCoder Beginner Contest 391.Contest URL: https://atcoder.jp/contests/abc391Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20250201T2100&p1=248Duration: 100 minutesWriter: sotanishy, toam, physics0523Tester: math957963, cn449...
久违的abc DE实现老半天FG一点思路没有, 视频播放量 163、弹幕量 0、点赞数 0、投硬币枚数 0、收藏人数 0、转发人数 0, 视频作者 cf能不能上个蓝, 作者简介 ,相关视频:Atcoder 301 E Pac-Takahashi 题解,Toyota Programming Contest 2023#4(AtCoder Beginner Contest 31
AtCoder Beginner Contest 391 A-G 简易题解,如果题解中有什么问题可以找我反馈,谢谢! A.Lucky Direction 没啥技巧,纯粹按照题目写 条件 signed main(){ string s; cin >> s; if(s=="N")cout<<"S"; if(s=="E")cout<<"W"; i…阅读全文 赞同15 7 条评论 分享收藏 ...
<bits/stdc++.h>usingnamespaceintint;cin>>N>>W;vector<vector<int>>bars(N+1);xi,yi;cin>>xi>>yi;bars[xi].push_back(yi);blockId[{xi,:sort(bar.rbegin(),bari].back());elseisComplete=endTime
题解 一开始想着是dp[i][j][k]表示未知串前i,已知串前j,lcs最大是k的方案数,发现没法转移, 例如??和abc,第一个字母填abc都有贡献,但是贡献的位置不一样, 并且一种确定的串如果有多种方案使得lcs=k的话,应该只有第一次达到k的lcs被唯一计数 ...
ABC391 G - Many LCS You are given a lowercase English string SS of length NN and an integer MM. For each k=0,1,⋯,Nk=0,1,⋯,N, solve the following problem: There are 26M26M lowercase English strings of length MM. Among these, find the number, modulo 998244353, of strings who...
1173 4 01:48:45 App AtCoder 初学者竞赛 399比赛讲解(ABC399) 1431 5 02:26:50 App AtCoder 初学者竞赛 395比赛讲解(ABC395) 1362 10 01:38:06 App AtCoder 初学者竞赛 396比赛讲解(ABC396) 878 1 02:11:20 App AtCoder 初学者竞赛 391比赛讲解(ABC391) 885 4 01:47:27 App AtCoder 初学者...
ABC357 ABC358 ABC359 ABC360 ABC360_2 ABC361 ABC362 ABC363 ABC364 ABC365 ABC366 ABC367 ABC368 ABC369 ABC370_20240907 ABC371_20240914 ABC372 ABC373 ABC374 ABC375 ABC376 ABC377 ABC378 ABC379 ABC380 ABC381 ABC382 ABC383 ABC384 ABC385 ABC386 ABC387 ABC388 ABC389 ABC390 ABC391 ALPC APG...
题解:明显是用BFS,但是我们要能步行就步行,尽量少使用魔法,所以我们可以用deque来存状态,将步行的状态放在前面,魔法的放在后面,这样就能保证优先步行,用结构体来表示状态即可. 代码: structmisaka{intx,y;intcnt;}e;intn,m;intsx,sy;intex,ey;charg[2000][2000];boolst[2000][2000];intdx[4]={0,0,...