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…
题目大意: 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…
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…
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…
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…
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…
因为省赛,从开学紧张到5月7号.心思也几乎全放在ACM的训练上.因为我还是校台球协会的会长,所以台协还有一些事情需要忙,但是我都给延迟了.老会长一直在催我办校赛,但我一直说 等等吧,因为校赛只能在周六或周日举办,而我们的ACM组队集训也都在周六周日, 如果我去支持校赛的话,那么一整天的集训就浪费了.不止这样,前期的准备工作也挺耗时的.就这样,我到现在都还没举办校赛(打算定在5月14号,不过那天我得去清华参加一个ACM邀请赛,所以还是主持不了,得让副会长去主持了,因为这个比赛不能再推了,再下个周又…
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…
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…
nyoj-1365-山区修路 内存限制:128MB 时间限制:3000ms 特判: No通过数:4 提交数:4 难度:3 题目描述: SNJ位于HB省西部一片群峰耸立的高大山地,横亘于A江.B水之间,方圆数千平方公里,相传上古的神医在此搭架上山采药而得名.景区山峰均在海拔3000米以上,堪称"华中屋脊".SNJ是以秀绿的亚高山自然风光,多样的动植物种,人与自然和谐共存为主题的森林生态区.SNJ处于中国地势第二阶梯的东部边缘,由大巴山脉东延的余脉组成中高山地貌,区内山体高大,高低不平.…
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…
题目描述     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 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…
  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…
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…
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…
第一次參加省赛有点小激动,尽管是作为打星队參赛,但心情却是上下起伏. 5月9号晚上11点多到威海,有点略冷.可是空气比淄博好多了,大家到了旅馆的时候都非常晚了,抱怨了一下三星级的酒店的待遇,喝杯咖啡早早的歇息了. 第二天一早被叫醒吃早餐,好歹也是三星级的酒店,早餐就是粥.榨菜,馒头.. .不抱怨了,事实上吃着早餐有点回到南方的感觉,在南方早餐基本上就是这样. .. 吃完早餐就没事做了,11点多的时候才到哈工大威海校区.校园尽管小了点.尽管校园建筑那么像美国白宫.那么像某个教堂.. .可是空气是好…
题目描述: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…
题目描述 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…
传送门 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是可以的 思路 容斥…
   如何设计一个好的数据库不仅仅是一个理论研究问题,也是一个实际应用问题.在关系数据库中不满足规范化理论的数据库设计会存在冗余.插入异常.删除异常等现象. 设R(U)是一个关系模式,U={ A1,A2, ……, An}.其中Ai是关系的属性,X,Y是U的子集.函数依赖 XàY 定义了数据库中属性集X与Y的依赖关系.根据Armstrong公理,函数依赖满足: (1)       自反律:若Ai∈X,  则 X->Ai .   特别地,Ai->Ai . (2)       增广律:若 X->…
这个专栏开始介绍一些<ACM国际大学生程序设计竞赛题解>上的竞赛题目,读者可以配合zju/poj/uva的在线测评系统提交代码(今天zoj貌似崩了). 其实看书名也能看出来这本书的思路,就是一本题解书,简单暴力的通过题目的堆叠来提升解决编程问题的能力. 那么下面开始探索吧. poj1037: Description Background For years, computer scientists have been trying to find efficient solutions to…
题目链接 2018 ACM 国际大学生程序设计竞赛上海大都会 下午午休起床被同学叫去打比赛233 然后已经过了2.5h了 先挑过得多的做了 .... A题 rand x*n 次点,每次judge一个点位端点的共线向量数判断是否大于给定x 强行rand 500次 代码 #include<bits/stdc++.h> using namespace std; inline int read() { int x = 0,f = 1; char c = getchar(); while(c <…