defsolve():a,b=MI()print(f'{b / a:.3f}')for_inrange(1):solve() B. Line Sensor B - Line Sensoratcoder.jp/contests/abc274/tasks/abc274_b 给定一个N∗M的矩阵,问每列有多少个#。 1≤H,W≤1000 逐个元素遍历即可。 def solve(): h, w = MI() res = [0 for _ in range(...
Polya定理说这个问题的答案是:1|G|∑g∈Gc(g,X)1|G|∑g∈Gc(g,X)。其中X表示所有外表不同的序列的集合;G表示把所有变换看成置换之后的置换群(置换群的概念请自行搜索);c(g,X)c(g,X)表示X中满足"将置换g施加到序列x上之后x的外表仍然不变"的元素x的个数,专业点说是不动...
LL>PLL;constintN=1e6+3;constintINF=0x3f3f3f3f,mod=1e9+7;constdouble eps=1e-6,PI=acos(-1);string s[N];voidsolve(){int n;cin>>n;for(int i=0;i<n;i++)cin>>s[i];for(int i=n-1;i>=0;i--)cout<<s[i]<<endl;}intmain(){IOS;int _=1;// cin >> _;while(_--)...
We will hold キーエンスプログラミングコンテスト2022(AtCoder Beginner Contest 274). Contest URL: https://atcoder.jp/contests/abc274 Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20221022T2100&p1=248 Duration: 100 minutes Number of Tasks: 8 Writer: Nyaan, kyo...
链接: E - Count Simple Paths分析: 这里要求解的是无向图,从一个节点出发的所有不同路径的个数,用DFS从节点开始进行遍历,这里和一般DFS不同的是,同一个节点可以多次访问, 只要保证每次递归的时候, 从初始节…
# AtCoder Beginner Contest 273(E) ## E(链式结构,思维) [E](https://atcoder.jp/contests/abc273/tasks/abc273_e) 题目大意就是原本有一个空的序列,我们后面会进行$q$次操作,每次操作我们都需要输出此时的序列的
I could not find the usual discussion post about the most recent atcoder contest, so I'm posting here. How to solve problem G?atcoder, beginner, contest, 294 +13 Ghassane 23 months ago 7 Comments (6) Show archived | Write comment? chromate00 23 months ago, # | +20 G: ...
AtCoder Beginner Contest 169(题解)E - Count Median结论题给定nnn个xi∈[ai,bi]x_i\in[a_i,b_i]xi∈[ai,bi],求中位数的个数。定义:k=⌊n2⌋k=\lfloor\dfrac{n}{2}\rfloork=⌊2n⌋,对a,ba,ba,b进行排序后,为ak+1a_{k+1}ak+1为aia_iai的中位数,bk+1...
AtCoder Beginner Contest 369 题解 A - 369#include<bits/stdc++.h> using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)# 算法 c++ 数据结构 线段树 树dp AtCoder Beginner Contest 366 题解 B -B - Vertical WritingC - Balls...
今天是被乱杀的一天,B题看不懂qwq。 进入正题: A - Saturday 签到 题意: 告诉你今天是星期几,求该距离周末还有多久。 分析: 计算到周六差几天即可。 时间复杂度:O(1) 代码: voidsolve(){string s;cin>>s;if(s[0]=='M')cout<<5;elseif(s[0]=='T'&&s[1]=='u')cout<<4;elseif(s[0]...