题目描述:There are n cities in Byteland, and the ith city has a value ai. The cost of building a bidirectional road between two cities is the sum of their values. Please  calculate the minimum cost of connecting these cities, which means any two cities c…
传送门 E.sequence •题意 定义序列 p 中的 "good",只要 i 之前存在 pj < pi,那么,pi就是 "good": 求删除一个数,使得序列中 "good" 的个数最多: •题解 一个数 pi 对 "good" 的贡献有两个来源: ①pi 本身为"good",对答案的贡献为 1: ②删除 pi 后,i 之后的本来是 "good" 的数因为 pi 被删除而变成非…
题目 F : Four-tuples  输入 1 1 1 2 2 3 3 4 4 输出 1 题意 给l1, r1, l2, r2, l3, r3,  l4, r4​ , 八个数据, 要求输出在区间[l1, r1] ,  [l2, r2] , [l3, r3] ,  [l4, r4​] (记为A, B, C, D)范围内, 各取一个数(取作x1, x2, x3, x4), 并且x1 != x2, x2 != x3, x3 != x4, x4 != x1, 注意像x1 == x3是可以的 思路 容斥…
因为省赛,从开学紧张到5月7号.心思也几乎全放在ACM的训练上.因为我还是校台球协会的会长,所以台协还有一些事情需要忙,但是我都给延迟了.老会长一直在催我办校赛,但我一直说 等等吧,因为校赛只能在周六或周日举办,而我们的ACM组队集训也都在周六周日, 如果我去支持校赛的话,那么一整天的集训就浪费了.不止这样,前期的准备工作也挺耗时的.就这样,我到现在都还没举办校赛(打算定在5月14号,不过那天我得去清华参加一个ACM邀请赛,所以还是主持不了,得让副会长去主持了,因为这个比赛不能再推了,再下个周又…
Problem H:Boring Counting Time Limit : 6000/3000ms (Java/Other)   Memory Limit : 65535/32768K (Java/Other) Problem Description In this problem you are given a number sequence P consisting of N integer and Pi is the ith element in the sequence. Now yo…
链接:https://www.nowcoder.com/acm/contest/89/A 来源:牛客网 1.题目描述 The Great Wall story of Meng Jiangnv’s Bitter Weeping happened during the Qin Dynasty (221BC- 206BC). Meng jiangnv was a beauty in the Qin Dynasty, and she lived happily with her husband. At…
2013年"浪潮杯"山东省第四届ACM大学生程序设计竞赛排名:http://acm.upc.edu.cn/ranklist/ 一.第J题坑爹大水题,模拟一下就行了 J:Contest Print Server [题解]: 题目大意:输入 n,s,x,y,mod  分别队伍数n,还有一个s生成函数 s=((s*x)+y)%mod,就是打印机根据要求打印纸张,打印到s时,打印机将重置,生成新的s [code]: #include <iostream> #include <…
n a^o7 ! 题目:http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2413 Time Limit: 1000MS Memory limit: 65536K 题目描写叙述 All brave and intelligent fighters, next you will step into a distinctive battleground which is full of sweet and h…
Mine Number 题目:http://acm.sdut.edu.cn/sdutoj/problem.php? action=showproblem&problemid=2410 Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描写叙述 Every one once played the game called Mine Sweeping, here I change the rule. You are given an n*m ma…
Alice and Bob Time Limit: 1000ms   Memory limit: 65536K 题目描述 Alice and Bob like playing games very much.Today, they introduce a new game. There is a polynomial like this: (a0*x^(2^0)+1) * (a1 * x^(2^1)+1)*.......*(an-1 * x^(2^(n-1))+1). Then Alice as…
点击打开链接 2226: Contest Print Server Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 53  Solved: 18 [Submit][Status][Web Board] Description In ACM/ICPC on-site contests ,3 students share 1 computer,so you can print your source code any time. Here you ne…
http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2877 题目描述 The problems called "Angry Birds" and "Angry Birds Again and Again" has been solved by many teams in the series of contest in 2011 Multi-University Tr…
Mountain Subsequences 题目描述 Coco is a beautiful ACMer girl living in a very beautiful mountain. There are many trees and flowers on the mountain, and there are many animals and birds also. Coco like the mountain so much that she now name some letter s…
1195: OS Job Scheduling Time Limit: 2 Sec  Memory Limit: 128 MB Submit: 106  Solved: 35 [id=1195" style="color:rgb(26,92,200); text-decoration:none">Submit][Status][Web Board] Description OS(Operating System) is to help user solve the pr…
nyoj-1365-山区修路 内存限制:128MB 时间限制:3000ms 特判: No通过数:4 提交数:4 难度:3 题目描述: SNJ位于HB省西部一片群峰耸立的高大山地,横亘于A江.B水之间,方圆数千平方公里,相传上古的神医在此搭架上山采药而得名.景区山峰均在海拔3000米以上,堪称"华中屋脊".SNJ是以秀绿的亚高山自然风光,多样的动植物种,人与自然和谐共存为主题的森林生态区.SNJ处于中国地势第二阶梯的东部边缘,由大巴山脉东延的余脉组成中高山地貌,区内山体高大,高低不平.…
第一次參加省赛有点小激动,尽管是作为打星队參赛,但心情却是上下起伏. 5月9号晚上11点多到威海,有点略冷.可是空气比淄博好多了,大家到了旅馆的时候都非常晚了,抱怨了一下三星级的酒店的待遇,喝杯咖啡早早的歇息了. 第二天一早被叫醒吃早餐,好歹也是三星级的酒店,早餐就是粥.榨菜,馒头.. .不抱怨了,事实上吃着早餐有点回到南方的感觉,在南方早餐基本上就是这样. .. 吃完早餐就没事做了,11点多的时候才到哈工大威海校区.校园尽管小了点.尽管校园建筑那么像美国白宫.那么像某个教堂.. .可是空气是好…
n a^o7 ! Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 All brave and intelligent fighters, next you will step into a distinctive battleground which is full of sweet and happiness. If you want to win the battle, you must do warm-up accord…
Identifiers Time Limit: 1000MS Memory limit: 65536K 题目:http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2163 题目描写叙述  Identifier is an important concept in the C programming language. Identifiers provide names for several languag…
去年打完区域赛之后,面对着两个队友都去找实习的情况,我自己对今年省赛还是有点慌的.不只一次的像我的队友说明自己很慌,但是老曹跟会长都说:“没事,慌啥!”前几场训练赛因为老曹跟秋洁有面试有时候只能一个人打,对自己也是一个很大的挑战.最后几场训练赛跟队友配合的打感觉整个队伍的状态回升了.就这样揣着忐忑的心情来到了省赛现场.热身赛的时候我被会长分配去女队教学妹使用pc^2系统,看榜老曹会长A掉了热身赛的B题当时就感觉我们的实力还在,内心也是挺感动的,后来发现dy跟奕辰他们A掉了A题,赛后我回到自己队伍…
题目描述     In ACM/ICPC on-site contests ,3 students share 1 computer,so you can print your source code any time. Here you need to write a contest print server to handle all the requests. 输入 In each case,the first line contains 5 integers n,s,x,y,mod (1…
题目大意: n个点,第i个点和第i+1个点可以构成向量,问最少删除多少个点可以让构成的向量顺时针旋转或者逆时针旋转. 分析: dp很好想,dp[j][i]表示以向量ji(第j个点到第i个点构成的向量)为终点的最大顺时针/逆时针向量数.状态转移方程为 dp[j][i] = max{dp[k][j]+1}. 问题个关键是如何判断2个向量是顺时针还是逆时针. 计算几何用的知识是求叉积和点积,叉积的作用是判断两个向量的左右(顺逆),点积的作用是判断两个向量的前后.举个例子,假设有2个向量v1,v2,‘*…
先看看上一个题: 题目大意是: 矩阵中有N个被标记的元素,然后针对每一个被标记的元素e(x,y),你要在所有被标记的元素中找到一个元素E(X,Y),使得X>x并且Y>y,如果存在多个满足条件的元素,先比较X,选择X最小的那个,如果还是有很多满足条件的元素,再比较Y,选择Y最小的元素,如果不存在就输出两个-1: 分析: 直接暴力就行了 这个题目大意: 这个题是上个题的坚强版,每次会增加或减少一个点,仍然找到一个元素E(X,Y),使得X>x并且Y>y: 最多有200000次操作,每次只…
题意 : 找联通块的个数,Saya定义两个相连是 |xa-xb| + |ya-yb| ≤ 1 ,但是Kudo定义的相连是 |xa-xb|≤1 并且 |ya-yb|≤1.输出按照两种方式数的联通块的各数. 思路 : 按照第一种定义方式就只能是上下左右四个位置,而第二种则是周围那8个都是相连的. #include <iostream> #include <stdio.h> #include <stdlib.h> #include <queue> #include…
  Alice and Bob Time Limit: 1000ms   Memory limit: 65536K 题目描述 Alice and Bob like playing games very much.Today, they introduce a new game. There is a polynomial like this: (a0*x^(2^0)+1) * (a1 * x^(2^1)+1)*.......*(an-1 * x^(2^(n-1))+1). Then Alice…
Hello World! Time Limit: 1000MS Memory limit: 65536K 题目描述 We know that Ivan gives Saya three problems to solve (Problem F), and this is the first problem. "We need a programmer to help us for some projects. If you show us that you or one of your frie…
Phone Number Time Limit: 1000MS Memory limit: 65536K 题目描述 We know that if a phone number A is another phone number B's prefix, B is not able to be called. For an example, A is 123 while B is 12345, after pressing 123, we call A, and not able to call…
C 暂时还不对 #include <iostream> #include <cstdio> #include <cmath> using namespace std; #define MOD 1000000007 typedef long long ll; ]; void jiecheng1(){ ll jiech=; ;i<=;i++){ jiech*=i; jiech%=MOD; jie[i]=jiech; } } ll jiecheng(ll aa){ re…
题目描述 Alice and Bob like playing games very much.Today, they introduce a new game. There is a polynomial like this: (a0*x^(2^0)+1) * (a1 * x^(2^1)+1)*.......*(an-1 * x^(2^(n-1))+1). Then Alice ask Bob Q questions. In the expansion of the Polynomial, G…
题目描述 In computer science, a binary tree is a tree data structure in which each node has at most two children. Consider an infinite full binary tree (each node has two children except the leaf nodes) defined as follows. For a node labelled v its left…
对哈尔滨出租车和纸质题目和2148473647的吐槽都被毕克神牛在知乎上(https://www.zhihu.com/question/59782275/answer/169402588)pick/ban掉了hhhhh 那就来说点愉快的事情吧~ 1.哈师大的小姐姐多!好多!真的多!这趟就算不拿奖单是旅游也值了! 2.报到那天在校外找校门找了很久,报到完为了吃午饭翘掉了开幕式,到食堂已经快一点半了,然而居然还有几个窗口有饭,好评>_<要了份黄焖鸡米饭在窗口等,然后居然被一个小姐姐搭讪了!这种事情…