Ruratania is just entering capitalism and is establishing new enterprising activities in many fields including transport. The transportation company TransRuratania is starting a new express train from
Ruratania is just entering capitalism and is establishing new enterprising activities in many fields including transport. The transportation company TransRuratania is starting a new express train from
最近ACM状态不好,脑袋锈了,
1116: Let it Bead Time Limit(Common/Java):1000MS/10000MS Memory Limit:65536KByteTotal Submit: 7 Accepted:4 Description "Let it Bead" company is located upstairs at 700 Cannery R...
标签: 堆的应用
#include #include #include using namespace std; #define N 110004 struct Heap{ int da[N],size; void clear(){ size=0; } void insert(int v,int id){ da[++size]=v;... while(tm>1){
题目链接 : http://acm.tju.edu.cn/toj/showp1398.html Given a set of sticks of various lengths, is it possible to join them end-to-end to form a square? The first line of input contains N, the number...
import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner;public class IsSquare2 {static int len; static int avg; static boolean[] isV;...static int[] seq;...
Tanning Salon Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 8063 Accepted: 4319 ...Tan Your Hide, Inc., owns several coin-operated tanning sal
题目链接 : http://acm.tju.edu.cn/toj/showp2789.html Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded ...
In HDFS( Hadoop Distributed File System), each data may have a lot of copies in case of data lose. This problem, every data has its own id, from 1 to n. To make things simple, each data has only two c...
#include #include #include #include #define MAXN 205 #define MAX 500000 using namespace std; int map[MAXN][MAXN]; int N, M, K, a, b, dis; struct Road { int city; int len;...bool c
Description Dr.Kong设计的机器人卡多掌握了加减法运算以后,最近又学会了一些简单的函数求值,比如,它知道函数min(20,23)的值是20 ,add(10,98) 的值是108等等。经过训练,Dr.Kong设计的机器人卡多甚至会计算一种...
题目链接:http://acm.tju.edu.cn/toj/showp2469.html 感觉这个题目有点问题,算了不管他了,反正A了。 这里要注意的是求这个集合有多少种,那么就是要剔除重复数后,再数一下有多少个。 难一点的算法我也不会,...
3596. Watch The MovieTime Limit: 2.0 Seconds Memory Limit: 65536KTotal Runs: 424 Accepted Runs: 148 New semester is coming, and DuoDuo has to go to school tomorrow. She decides to have fun...
题目链接 水题,类似求最短距离,枚举比较大小即可#include using namespace std; int main() { int r[16],b[16],g[16]; for(int i=0;i;i++) scanf("%d %d %d",&r[i],&g[i],&b[i]); int red,green,blue;
题目链接:http://acm.tju.edu.cn/toj/showp1868.html 1868. Count the factors Time Limit: 0.5 Seconds Memory Limit: 65536K Total Runs: 2691 Accepted Runs: 855 The Problem ...
题意/Description: A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 to N . No two places have the sam...
描述 Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the University of ...
题目链接 这道题不难,就是函数求极值问题。其次要得出符合函数F(x)是一个凸函数或者是单调递增的函数。古可以用三分的方法。虽然简单但我也错了好几次,总结一下: 报错、超时一次,是由于浮点数精度的问题。...
Given a set of sticks of various lengths, is it possible to join them end-to-end to form a square? The first line of input contains N, the number of test cases. Each test case begins with an integ.....
http://acm.tju.edu.cn/toj/showp3540.html3540.ConsumerTime Limit:2.0 Seconds Memory Limit:65536KTotal Runs:136 Accepted Runs:67 FJ is going to do some shopping, and before that, he need...
FJ is going to do some shopping, and before that, he needs some boxes to carry the different kinds of stuff he is going to buy. Each box is assigned to carry some specific kinds of stuff (that is to s...
题目链接:http://acm.tju.edu.cn/toj/showp2469.html 题目大意:给定一些人,如果他们不是朋友,就不能住在一间房间。朋友间的关系是可以传递的,即A和B是朋友,B和C是朋友,那么A和C也是朋友。 给定人数和他们的...
题目链接:http://acm.tju.edu.cn/toj/showp3843.html 题目大意:求两个set的交集 思路:一开始写了个,超时了;然后才想到后面数组过大:160000,才想到二分查找 二分查找(要查找的值,左边界,右边界),查找...
ho-ho- 又连赢 又要打晋级赛了 TM的 白银2 - > 白银1 这是第4次了 ....... 快点写了这题 洗个澡 晚上还要看CR7了 touch me 这题的题意 我不用说了吧 太清晰了 讲下我的做法: ... 具备什么样的条件 末尾才会...
4081. God Le wants to know the directory Time Limit: 1.0 Seconds Memory Limit: 65536K Total Runs: 394 Accepted Runs: 135 ...God Le is the most talented ACMer in the TJU-ACM team.
思路:将其转化为正方形,即求离给出的中心的距离在a-b之间的范围的点的数目#include #include #include #include #include #include #include #include #include #include <cs
题意:求离一个城市第k远的城市的编号,无负权边。 思路:根据dijstra算法的特点可以知道,外层循环n次,每次求出的点就是离源点第i远的点的最短路。所以迭代k次,第k次新求出的点即为答案。 ...
zheh #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;...istream& operator>>(istream&
刚开始把它想成了贪心,结果怎么也出不来,结果只是简单地dfs加上回溯 将一个方格看做一个点,刚开始全部置为0,若有物品放置,则置为1;#include #include #include #include #include #include ...