contest programming beginner atcoder

AtCoder Beginner Contest 156

AtCoder Beginner Contest 156 https://atcoder.jp/contests/abc156 D - Bouquet 组合数学。 二项式定理。 注意取模之前一定要保证他是正数(有时候只加一次mod可能不够) #include <bits/stdc++.h> #def ......
Beginner AtCoder Contest 156

AtCoder Beginner Contest 226(E,F,G)

AtCoder Beginner Contest 226(E,F,G) E(并查集) E 这个题的大意是给我们一个无向图,我们可以把这些无向边变成有向边,让每一个点的入度都是$1$,问有多少种变化方式 要让有$x$个点的无向图,形成一棵树的边的数量是$x-1$,但是我们需要的是每一个点的入度为$1$ ......
Beginner AtCoder Contest 226

AtCoder杂题记

ABC20D 题意: 给定 $n\le 10^9,k\le 100$ ,求 $\sum\limits_{i=1}^n \text{lcm}(i,k)$,对 $10^9+7$ 取模。 做法: $\sum\limits_{i=1}^n \text{lcm}(i,k)=\sum\limits_{i=1}^ ......
题记 AtCoder

AtCoder Regular Contest 158 D - Equation

题目链接 原本看着式子直接晕了,觉得是高深的硬核数论,于是放弃(然后E也没想出来,sad) 关键的思路在于,考虑构造由**(a,b,c)->(ta,tb,tc)**这样的求解方式。 在看到这个做法后,会发现它很好地利用了题目齐次的性质;至于如何由齐次式想到这个做法,可能需要足够的天赋或者经验吧(悲) ......
Equation AtCoder Regular Contest 158

SMU Spring 2023 Trial Contest Round 4 (4.4)

SMU Spring 2023 Trial Contest Round 4 (^_^) A小石的图形 思路:pi=acos(-1) #include<bits/stdc++.h> using namespace std; typedef pair<int,int>PII; const int N=1 ......
Contest Spring Round Trial 2023

AtCoder Beginner Contest 294(E,F,G)

AtCoder Beginner Contest 294(E,F,G) E (思维,双指针) E 这个题的大意就是有一个$2$行$L$列的网格,每个格子里面都有不同的数字,但是它的输入方式不是一个一个输入的,而是从第一个开始,枚举每个数在这一段的数量,(比如$a_1=2,L_1=3$,那么此时就已经 ......
Beginner AtCoder Contest 294

[Leetcode Weekly Contest]339

链接:LeetCode [Leetcode]2609. 最长平衡子字符串 给你一个仅由 0 和 1 组成的二进制字符串 s 。 如果子字符串中 所有的 0 都在 1 之前 且其中 0 的数量等于 1 的数量,则认为 s 的这个子字符串是平衡子字符串。请注意,空子字符串也视作平衡子字符串。 返回 s ......
Leetcode Contest Weekly 339

AtCoder Beginner Contest 154

AtCoder Beginner Contest 154 https://atcoder.jp/contests/abc154 今天也比较简单。 E - Almost Everywhere Zero 贪心或者数位dp。 (其实我这个贪心应该就是在模拟数位dp) 贪心 #include <bits/s ......
Beginner AtCoder Contest 154

AtCoder Beginner Contest 296

AtCoder Beginner Contest 296 比赛连接 好久没写题解了~~ D - M<=ab 题意就是给定N,M, 求一个最小的数x同时满足x>=M且x=a*b(a<=N,b<=N); N,M<=1e12 开始脑瘫想了二分,仔细一想很明显x不满足单调性,想了下暴力的时间复杂度巨大... ......
Beginner AtCoder Contest 296

AtCoder Beginner Contest 144

AtCoder Beginner Contest 144 https://atcoder.jp/contests/abc144 补一下3.23做的。 D - Water Bottle 分类讨论,三角函数。 #include <bits/stdc++.h> #define pi acos (-1) u ......
Beginner AtCoder Contest 144

AtCoder Beginner Contest 296 A-E

AtCoder Beginner Contest 296 A - Alternately 1 void solve(){ 2 int n=read(); 3 string s; 4 cin>>s; 5 int ans=1; 6 for(int i=0;i<s.size()-1;i++){ 7 if( ......
Beginner AtCoder Contest 296 A-E

AtCoder Beginner Contest 296

AtCoder Beginner Contest 296 赛时代码 A - Alternately // Problem: A - Alternately // Contest: AtCoder - AtCoder Beginner Contest 296 // URL: https://atcod ......
Beginner AtCoder Contest 296

AtCoder Beginner Contest 296 做题记录

D - M<=ab 题意:求最小的正整数,不小于 $m$,且能被表示为两个不大于 $n$ 的正整数的数,不存在输出 -1。$n,m\le10^{12}$。 直接枚举 $a$,计算最小的满足 $ab\ge m$ 的 $b$,如果 $a>b$ 则后面的情况一定是重复的。时间复杂度 $\text{O}(\ ......
Beginner AtCoder Contest 296

AtCoder Beginner Contest 153

AtCoder Beginner Contest 153 https://atcoder.jp/contests/abc153 这套比较简单。 E - Crested Ibis vs Monster 完全背包 #include <bits/stdc++.h> #define ll long long ......
Beginner AtCoder Contest 153

AtCoder Beginner Contest 296

E Transition Game 拓扑跑环。 C++ Code #include "bits/stdc++.h" using namespace std; using i64 = long long; int main() { ios::sync_with_stdio(false); cin.ti ......
Beginner AtCoder Contest 296

AtCoder Beginner Contest 296 ABCD

https://atcoder.jp/contests/abc296 ###A - Alternately #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<LL,LL> PII; cons ......
Beginner AtCoder Contest ABCD 296

AtCoder Beginner Contest 296

295? 上周ECF玩去了,咕咕咕 A - Alternately (abc296 a) 题目大意 给定一个包含$MF$的字符串,问是否是 $M,F$交替出现的。 解题思路 判断相邻字母是否相等即可。 神奇的代码 ```cpp #include using namespace std; using ......
Beginner AtCoder Contest 296

AtCoder Beginner Contest 152

AtCoder Beginner Contest 152 https://atcoder.jp/contests/abc152 F我看了半天,编码方式那里还算是感觉比较玄乎,这题确实妙。 D - Handstand 2 只需记录两端数字即可,不要想太复杂。 #include <bits/stdc++ ......
Beginner AtCoder Contest 152

Solution Set - Atcoder (on scene)

/ 哪怕只是一瞥见谜底就坠落 还有无数个想探求的巧合 / / 哪怕只是领悟到答案的晦涩 也全力证明所经过都值得 / ......
Solution Atcoder scene Set on

AtCoder Beginner Contest 295

题解报告 基本的一些理解和问题都在注释中 A:Probably English //水题 #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <string> #include ......
Beginner AtCoder Contest 295

AtCoder Beginner Contest 151

AtCoder Beginner Contest 151 https://atcoder.jp/contests/abc151 这一套质量一般 E - Max-Min Sums 组合数学 #include <bits/stdc++.h> #define ll long long using name ......
Beginner AtCoder Contest 151

【vue : 无法加载文件 G:\Program Files\nodejs\vue.ps1,因为在此系统上禁止运行脚本】问题解决

问题 全局安装vue-cli后,安装没问题,但是执行vue -V查看版本时出问题 出现这个报错的原因:在电脑上启动 Windows PowerShell 时,执行策略极大可能是 Restricted(默认设置)。Restricted 策略不允许任何脚本运行,防止执行不信任的脚本。 解决问题 1、可以 ......
脚本 vue Program 文件 nodejs

AtCoder Beginner Contest 150

AtCoder Beginner Contest 150 https://atcoder.jp/contests/abc150 def都蛮不错的 D - Semi Common Multiple 先推一下:$x=a_i\times(p+0.5)\rightarrow x=\frac{a_i}2(2p ......
Beginner AtCoder Contest 150

AtCoder Beginner Contest 149

AtCoder Beginner Contest 149 https://atcoder.jp/contests/abc149 D - Prediction and Restriction 读题的锅!!没说输了要扣分!!! 两种做法。 贪心 对于相同格子 $i,i+k,i+2k,...$ 采取赢,平 ......
Beginner AtCoder Contest 149

【题解】Atcoder AGC034E Complete Compress

题目分析: 看到数据范围显然考虑先枚举一个集合点,也就是根。 设 $g_u = \sum_{v \in tree_u \and col_u = 1} dis(u,v)$,那么我们一次操作就是让 $g_u$ 减二或者不变,而不变的操作就是在 $u$ 的同一棵子树内的操作是没有影响的。 因为我们可以将 ......
题解 Complete Compress Atcoder 034E

[Algorithm] Dynamic programming - 02 - Longest Common Subsequence - Drawing 2d matrix + back tracing

Write a function that takes in two strings and returns their longest common subsequence. A subsequence of a string is a set of characters that aren't ......

AtCoder Beginner Contest 245

A - Good morning #include <bits/stdc++.h> using namespace std; int32_t main() { int a , b , c , d; int ta , ao; cin >> a >> b >> c >> d; ta = a * 60 * ......
Beginner AtCoder Contest 245

AtCoder Beginner Contest 246

AtCoder Beginner Contest 246 A (思维) A 这个题大意是告诉你一个矩形的三个点,求第四个点,并且已知每条边都是平行于$x$轴或者是$y$轴的,那么我们可以确定,$x$坐标只有两种,并且每一种都有两个,$y$坐标也是 题目输入三个坐标,那么答案就是缺少的那个个(数量为$ ......
Beginner AtCoder Contest 246

Go Expert Programming之iota

前言 iota常用于const表达式中,且其值是从零开始,const声明块中每增加一行iota值自增1。 使用iota可以简化常量定义,但其规则必须要牢牢掌握,否则在我们阅读别人源码时可能会造成误解或障碍。本节我们尝试全面的总结其使用场景,另外花一小部分时间看一下其实现原理,从原理上把握可以更深刻的 ......
Programming Expert iota Go

AtCoder Beginner Contest 295

A - Probably English #include <bits/stdc++.h> using namespace std; int read() { int x = 0, f = 1, ch = getchar(); while ((ch < '0' || ch > '9') && ch ......
Beginner AtCoder Contest 295