atcoder equal 100d arc

equals和“==”都得到错结果

今天java查bug 查到一个奇怪的现象,用RecordSet rs = new RecordSet()从数据库查数据,与字符串做对比,无论用equals和“==”都得到错误的结果,后来问了下老师傅,在equals前加了trim().,意思是去掉原字符串开头和结尾的空格、回车、换行符等不可见字符。然 ......
结果 equals

ARC163

## ARC163 ### A 显然划分两次最优,直接枚举即可 ```cpp #include using namespace std; const int MAXN=2005; int t; int n; char s[MAXN]; int main() { // freopen("date.in ......
ARC 163

Atcoder杂题笔记

大概会把博客当草稿纸用( 当然写出正解还是会把正解贴出来。 - - - #### [ARC080E] Young Maids (待补代码) 给定正偶数 $N$。 给定 $N$ 元排列 $p = (p_1, p_2, ..., p_N)$. Snuke 打算根据下述步骤构造一个 $N$ 元排列 $q$ ......
Atcoder 笔记

== 和 equals 比较的区别?

让我看下面一个例子: char[] chs={'a','b','c'}; String s1=new String(chs); String s2=new String(chs); System.out.println(s1==s2); System.out.println(s1.equals(s2 ......
equals

java中 == 和 equals

== 操作符用于 基本数据类型 时是对 值 的比较,用于 对象 则是对 引用 的比较。equals是java.lang包中Object类中的一个方法。Obejct是所有类的超类,所有类的实例都可以调用equals方法。Object中的equals方法:默认也是对比的对象的引用。 public boo ......
equals java

Atcoder ABC307_G-Approximate Equalization 序列dp

# [AT_ABC307_G-Approximate Equalization](https://atcoder.jp/contests/abc307/tasks/abc307_g "ABC307_G") [没想到还有Approximate Equalization II !!:AT_ABC313_ ......

AtCoder-ARC073_A Sentou

Sentou 【题意】: 有一个开关,当按下开关后的 T 秒内会一直放水,当在放水状态时,如果有人再次按下开关,那么停止放水,并从按下的那一刻起的 T 秒会再次一直放水,给出 n 个人按压开关的时间,问总共流出多少水 【思路】: 简单模拟 #include <bits/stdc++.h> using ......
AtCoder-ARC AtCoder Sentou ARC 073

Make Equal 题解

# [Make Equal](https://www.luogu.com.cn/problem/CF1188D) ## 题目大意 给出 $n$ 个数字 $a_1,a_2,a_3,......,a_n$,每次操作可以给其中一个数加上 $2$ 的非负整数次幂。求最少的操作次数,使得这 $n$ 个数相等。 ......
题解 Equal Make

AtCoder Beginner Contest 313

AtCoder Beginner Contest 313 A - To Be Saikyo 思路:找到最大的,和第一个比较 #include<bits/stdc++.h> using namespace std; #define int long long //#define int __int12 ......
Beginner AtCoder Contest 313

AtCoder Beginner Contest 313

# [AtCoder Beginner Contest 313 - AtCoder](https://atcoder.jp/contests/abc313) ## [A - To Be Saikyo (atcoder.jp)](https://atcoder.jp/contests/abc313/t ......
Beginner AtCoder Contest 313

取数游戏 Atcoder-abc128_d

枚举两端取了几个数,将手中的负数从小到大放回序列即可 ``` #include using namespace std; int n, m, a[55], c[55], ans = -0x7fffffff; int main() { scanf("%d%d", &n, &m); for (int i ......
Atcoder-abc Atcoder 128 abc

P9498 「RiOI-2」equals题解

题目传送门:P9498 「RiOI-2」equals - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 这是洛谷月赛Div.2 T3 ,由于我比较菜,只能赛场上切到T3(T4是黑。),开题我们很容易就看出这道题首先需要初始化每个点到根节点的最短路,而且边权都为1,所以我们先无脑打一个 ......
题解 equals P9498 9498 RiOI

Atcoder Grand Contest 058 F - Authentic Tree DP

考虑给 $f(T)$ 赋予组合意义。一个直观的想法是,在每条边中间新建一个节点,然后每次选择一条边对应的点,然后把它删掉,递归剩余的两个部分,但是你会发现这样分母不对,应该是 $n$ 但在这个模型里只有 $n-1$。 考虑魔改这个模型。我们在每个边对应的点下面添加 $998244352$ 个点,你发 ......
Authentic Atcoder Contest Grand Tree

Atcoder ABC313_C-Approximate Equalization 2

# [AT_ABC313_C-Approximate Equalization 2](https://atcoder.jp/contests/abc313/tasks/abc313_c "ABC313_C") ## Description: - 给定一个整数序列 $A=(A_1,A_2,···,A_ ......

Atcoder Beginner Contest 313

## [C](https://atcoder.jp/contests/abc313/tasks/abc313_c) > ## [D](https://atcoder.jp/contests/abc313/tasks/abc313_d) ## [E](https://atcoder.jp/contes ......
Beginner Atcoder Contest 313

AtCoder Beginner Contest 313

# A - To Be Saikyo ```cpp #include using namespace std; int main(){ ios::sync_with_stdio(0),cin.tie(0); int n; cin >> n; vector a(n); for( auto & i : ......
Beginner AtCoder Contest 313

「解题报告」AtCoder Beginner Contest 313

比赛地址:[AtCoder Beginner Contest 313 - AtCoder](https://atcoder.jp/contests/abc313) 后记:**请正确理解题意后再做题!!!** ## A - To Be Saikyo [A - To Be Saikyo (atcoder ......
Beginner AtCoder Contest 报告 313

AtCoder Beginner Contest (ABC) 313 D-E

Tasks - AtCoder Beginner Contest 313 PS:当时看到D过的比E多就一直在考虑D,但还没做出来,其实个人感觉E比D简单。 D - Odd or Even 交互题。有n个数,最多可以询问n次然后要求判断出这n个数的奇偶性。每次可以询问数组里任意k个元素的和是不是奇数 ......
Beginner AtCoder Contest ABC 313

AtCoder Beginner Contest 313

# AtCoder Beginner Contest 313 ## G - Redistribution of Piles ### 题意翻译: 给定一个数列$a_i(a_i>0, i\in[1,n])$,和一个数$s$(初值为0),有两种操作 - A - 全局非零数减一,减去的和加到$s$ - B ......
Beginner AtCoder Contest 313

AtCoder Beginner Contest 313 A-E Code

比赛链接:AtCoder Beginner Contest 313 - AtCoder A: #include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int ......
Beginner AtCoder Contest Code 313

AtCoder Beginner Contest 313

> ~~貌似这次很难,还好去吃烧烤了~~ ## [A - To Be Saikyo (abc313 A)](https://atcoder.jp/contests/abc313/tasks/abc313_a) ### 题目大意 给定$n$个数$a_i$,问第一个数要成为唯一的最大的数,应该加多少。 ......
Beginner AtCoder Contest 313

Practice on Codeforces and Atcoder in August

## [Educational Codeforces Round 151 A~E](https://www.cnblogs.com/oierpyt/p/17598936.html) ## [Codeforces Round #879 Div.2](https://www.cnblogs.com/oi ......
Codeforces Practice Atcoder August and

ARC149

## ARC149 ### A 直接记录$1111..$然后$check$一下即可 ```cpp #include using namespace std; const int MAXN=1e5+5; int n; int m; int Mtl[MAXN]; signed main() { // f ......
ARC 149

ARC155

## ARC155 ### A 模拟一下你会发现这个长度为$k$子串$T$会在左右依次填$S,S^{rev}$ 这个我们可以直接让$k\bmod 2n$(最开始$\bmod n$了\kk) 然后你会发现填到最后就是$T$前$n$个$S^{rev}$,后面$S$ 直接$check$一下即可 ```cp ......
ARC 155

[ARC093F] Dark Horse

Problem StatementThere are $2^N$ players, numbered $1, 2, ..., 2^N$. They decided to hold a tournament. The tournament proceeds as follows: Choose a p ......
Horse 093F Dark ARC 093

Toyota Programming Contest 2023#4(AtCoder Beginner Contest 311)

# Preface 补下好久之前打的比赛博客 这场前面都写的挺稳的,然后一到G就降智了没写出来 # A - First ABC 签到 ```cpp #include #include #include #include #include #include #include #include #inc ......
Contest Programming Beginner AtCoder Toyota

ARC160

## ARC160 ### A 一眼没思路/kk 对于操作$(l1,r1)$,$(l2,r2)$我们是可以直接比较两者之间的大小的 然后用$nth\_element$即可 好像有$O(nlog(n))$做法 就是考虑每个位置的答案是什么,如果确定了前$i-1$个是没变的时候取答案,第$i$位的答案要 ......
ARC 160

题解 ARC104F

## 前言 在这里首先感谢一下题解区的 [FZzzz](https://www.luogu.com.cn/user/174045),本人的题解思路主要是基于他并给出了自己的理解。 如非特殊说明,本题解中的数学符号原则上与题目中一致。 ## 题目分析 需要转化的喵喵题。 我们需要把原问题转化成一个图论 ......
题解 104F ARC 104

nfls15095 Atcoder-abc123_d 蛋糕

Atcoder-abc123_d AT 小卖部从下学期开始售卖带有数字形状的蛋糕,$X$,$Y$ 和 $Z$ 种蛋糕分别带有 $1$ 形,$2$ 形和 $3$ 形蜡烛,而且每个蛋糕都有美味值,如下所示: - 带有 $1$ 形蜡烛的美味值有: $A_1,A_2,\cdots,A_X$ - 带有 $2$ ......
Atcoder-abc 蛋糕 Atcoder 15095 nfls

ARC089B 题解

[problem](https://www.luogu.com.cn/problem/AT_arc089_b) & [blog](https://www.cnblogs.com/liangbowen/p/17599062.html)。 给一个比较暴躁的做法。 若要求 $(x,y)$ 的颜色为 Whi ......
题解 089B ARC 089