下午连着两场比赛,爽. 首先是codeforses,我和一位dalao一起打的,结果考炸了,幸亏不计rating.. A Alice the Fan 这个就是记忆化搜索一下预处理,然后直接回答询问好了,我肯定是傻逼了,还写了这么长,幸亏调处来了. #include<cstdio> #include<cstring> #include<algorithm> #include<queue> #include<vector> using namespa
排序题 PAT (Advanced Level) Practice 排序题 目录 <算法笔记> 6.9.6 sort()用法 <算法笔记> 4.1 排序题步骤 1012 The Best Rank (25) 1083 List Grades (25) 1137 Final Grading (25) 1141 PAT Ranking of Institutions (25) 1153 Decode Registration Card of PAT (25) <算法笔记>
在敌人死亡后,会出现分数,如果敌人死亡的位置在屏幕内,那么使得获得的分数显示在屏幕内,超出屏幕范围的,显示在屏幕外 当然,这里例子是使得场景中的物体显示在屏幕内,当然也可以使用纯粹的UGUI物体的显示,但是换算方式上刚好相反. 有如下脚本,脚本挂在分数物体上 using System.Collections; using System.Collections.Generic; using UnityEngine; public class Test01 : MonoBehaviour { Tra
比赛链接:https://atcoder.jp/contests/abc170 A - Five Variables 题意 $5$ 个数中有 $1$ 个 $0$,判断是第几个. 代码 #include <bits/stdc++.h> using namespace std; int main() { for (int i = 1; i <= 5; i++) { int x; cin >> x; if (x == 0) { cout << i << &q
AtCoder Beginner Contest 184 题解 目录 AtCoder Beginner Contest 184 题解 A - Determinant B - Quizzes C - Super Ryuma D - increment of coins E - Third Avenue F - Programming Contest 这把怎么感觉题目都比以往的ABC水啊,拜此所赐我只是程序写得慢就排名狂掉( A - Determinant 求二阶矩阵的行列式,是小学常见自定义题目(
点我看题 A - Max Mod Min 非常诈骗.一开始以为要观察什么神奇的性质,后来发现直接模拟就行了.可以证明总操作次数是\(O(nlog a_i)\)的.具体就是,每次操作都会有一个数a被b取模,然后变成a%b.注意到a%b是\(\leq \frac a2\)的,并且a被操作之后会变成整个数据最小的数,作为下一轮的b.所以把原数组排序后,最小值的位置是不断往左移的,每次移动1个位置,直接模拟即可. 时间复杂度\(O(nlog a_i)\). 点击查看代码 #include <bits/s
Write a SQL query to rank scores. If there is a tie between two scores, both should have the same ranking. Note that after a tie, the next ranking number should be the next consecutive integer value. In other words, there should be no "holes" be
Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating, enclose the repeating part in parentheses. For example, Given numerator = 1, denominator = 2, retu