A.Movie 题意是给n个线段,要求求出是否存在三个不相交的线段,是的话输出yes,否则输出no.根据贪心的想法,可以先找出右端点r'最小的线段,他是三条线段中最左的那条,再找出左端点l'最大的线段,他是三条线段中最右的那条,这样我们只需要找出是否存在一条线段可以放在中间,即区间[l,r],l>r',r<l'. 代码 #include<cstdio> int n; long long L,R,l,r,a,b,c,d,mi,mx,flag,u,v,i; int main() { i…
Cycle Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 865 Accepted Submission(s): 241 Problem Description Ery is interested in graph theory, today he ask BrotherK a problem about it: Given…
最近在尝试做acm试题,刚刚是1001题就把我困住了,这是题目: Problem Description In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n. Input The input will consist of a series of integers n, one integer per line Output For each case, output SUM(n) in one…
数据测试了好几个都没问题,可以就是WA不让过,检测了2个小时还是没发现有什么问题T_T!!求高手看看代码,小弟在此谢谢各位哦! #include <stdio.h> #include <stdlib.h> #define max 1000 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int…
#include<stdio.h> #include<string.h> #include<math.h> #include<stdlib.h> #include<algorithm> #include<iostream> #include<queue> #include<vector> using namespace std; #define N 1005 int main() { int n; ,,,};…