摘要:原文链接:https://www.cnblogs.com/xwl3109377858/p/11405773.html Educational Codeforces Round 71 (Rated for Div. 2) D - Number Of Permutations You are given
阅读全文
摘要:原文链接:https://www.cnblogs.com/xwl3109377858/p/11404321.html Educational Codeforces Round 71 (Rated for Div. 2) C - Gas Pipeline You are responsible for
阅读全文
摘要:原文链接:https://www.cnblogs.com/xwl3109377858/p/11404261.html Educational Codeforces Round 71 (Rated for Div. 2) B - Square Filling You are given two mat
阅读全文
摘要:原文链接:https://www.cnblogs.com/xwl3109377858/p/11404050.html Educational Codeforces Round 71 (Rated for Div. 2) A - There Are Two Types Of Burgers There
阅读全文
摘要:原文链接:https://www.cnblogs.com/xwl3109377858/p/11403644.html Problem Description 在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的
阅读全文
摘要:先建图,根据边计算所有顶点的入度,然后扫一遍将入度为0的顶点入队, 同时,该顶点指向的顶点入度减一,在队列中重复此操作, 直到所有点都被分离,如果顶点没有全部分离出来, 那么说明有环,不存在拓扑序,无解,详情见代码。
阅读全文
摘要:Stall Reservations Description Oh those picky N (1 <= N <= 50,000) cows! They are so picky that each one will only be milked over some precise time in
阅读全文
摘要:Balanced Lineup Description For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides
阅读全文
摘要:回文数 题目描述 若一个数(首位不为零)从左向右读与从右向左读都一样,我们就将其称之为回文数。 例如:给定一个10进制数56,将56加56(即把56从右向左读),得到121是一个回文数。 又如:对于10进制数87: STEP1:87+78 = 165 STEP2:165+561 = 726 STEP
阅读全文
摘要:单词接龙 题目描述 单词接龙是一个与我们经常玩的成语接龙相类似的游戏,现在我们已知一组单词,且给定一个开头的字母,要求出以这个字母开头的最长的“龙”(每个单词都最多在“龙”中出现两次),在两个单词相连时,其重合部分合为一部分,例如beast和astonish,如果接成一条龙则变为beastonish
阅读全文
摘要:Codeforces Round #577 (Div. 2) 原文链接:https://www.cnblogs.com/xwl3109377858/p/11306077.html C - Maximum Median You are given an array a of n integers, w
阅读全文
摘要:Codeforces Round #577 (Div. 2) B - Zero Array You are given an array a1,a2,…,an. In one operation you can choose two elements ai and aj (i≠j) and decr
阅读全文
摘要:Codeforces Round #577 (Div. 2) A - Important Exam A class of students wrote a multiple-choice test. There are n students in the class. The test had m
阅读全文
摘要:Codeforces Round #576 (Div. 2) D - Welfare State There is a country with n citizens. The i-th of them initially has ai money. The government strictly
阅读全文
摘要:Codeforces Round #576 (Div. 2) C - MP3 One common way of digitalizing sound is to record sound intensity at particular time moments. For each time mom
阅读全文
摘要:Codeforces Round #576 (Div. 2) B - Water Lily While sailing on a boat, Inessa noticed a beautiful water lily flower above the lake's surface. She came
阅读全文
摘要:Codeforces Round #576 (Div. 2) A - City Day For years, the Day of city N was held in the most rainy day of summer. New mayor decided to break this tra
阅读全文
摘要:lowbit(n)定义为非负整数n,在二进制表示下“最低位的1及其后面所有的0” 构成的数值。例如 n=10 二进制表示为(1010),则 lowbit (n) = 2 (10),当我们对计算出的 lowbit(n) 进行取log2操作 后,我们可以得到“n的二进制表示下最低位1的位置”,为了 得到
阅读全文
摘要:1218: [HNOI2003]激光炸弹 Description 一种新型的激光炸弹,可以摧毁一个边长为R的正方形内的所有的目标。现在地图上有n(N<=10000)个目标,用整数Xi,Yi(其值在[0,5000])表示目标在地图上的位置,每个目标都有一个价值。激光炸弹的投放是通过卫星定位的,但其有一
阅读全文
摘要:阶乘之和 题目描述 用高精度计算出S=1!+2!+3!+…+n!(n ≤ 50)其中“!”表示阶乘,例如:5!=5*4*3*2*1。 输入描述: 输入正整数N 输出描述: 输出计算结果S 示例1 输入 3 输出 9 思路:这里直接用两个自己写的大数运算的函数,模拟手写加法和乘法解决。
阅读全文