”toj“ 的搜索结果

     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

     #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;...

     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...

TOJ 1557.Color Me Less

标签:   toj  水题

     题目链接 水题,类似求最短距离,枚举比较大小即可#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;

      题意/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...

     题目链接: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 这题的题意 我不用说了吧 太清晰了 讲下我的做法: ... 具备什么样的条件 末尾才会...

toj3852. Haitang1

标签:   acm  toj

     思路:将其转化为正方形,即求离给出的中心的距离在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 ...

10  
9  
8  
7  
6  
5  
4  
3  
2  
1