ural 1218. Episode N-th: The Jedi Tournament
1218. Episode N-th: The Jedi Tournament
Memory limit: 64 MB
Input
Output
Sample
| input | output |
|---|---|
5 |
Anakin |
Problem Source: The Seventh Ural State University collegiate programming contest
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <ctime>
using namespace std;
typedef long long LL;
typedef double DB;
#define For(i, s, t) for(int i = (s); i <= (t); i++)
#define Ford(i, s, t) for(int i = (s); i >= (t); i--)
#define Rep(i, t) for(int i = (0); i < (t); i++)
#define Repn(i, t) for(int i = ((t)-1); i >= (0); i--)
#define rep(i, x, t) for(int i = (x); i < (t); i++)
#define MIT (2147483647)
#define INF (1000000001)
#define MLL (1000000000000000001LL)
#define sz(x) ((int) (x).size())
#define clr(x, y) memset(x, y, sizeof(x))
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define ft first
#define sd second
#define mk make_pair
inline void SetIO(string Name) {
string Input = Name+".in",
Output = Name+".out";
freopen(Input.c_str(), "r", stdin),
freopen(Output.c_str(), "w", stdout);
} inline int Getint() {
int Ret = ;
char Ch = ' ';
while(!(Ch >= '' && Ch <= '')) Ch = getchar();
while(Ch >= '' && Ch <= '') {
Ret = Ret*+Ch-'';
Ch = getchar();
}
return Ret;
} const int N = ;
struct JediType {
string Name;
int a, b, c; inline void Read() {
cin>>Name;
scanf("%d%d%d", &a, &b, &c);
} inline bool operator >(const JediType &T) const {
return ((a >= T.a)+(b >= T.b)+(c >= T.c)) >= ;
}
} Jedi[N];
int n;
bool F[N][N]; inline void Input() {
scanf("%d", &n);
For(i, , n) Jedi[i].Read();
} inline void Solve() {
For(i, , n)
For(j, , n)
if(Jedi[i] > Jedi[j])
F[i][j] = ; For(k, , n)
For(i, , n)
For(j, , n)
F[i][j] |= F[i][k]&F[k][j]; For(i, , n) {
bool Flag = ;
For(j, , n)
if(!F[i][j]) {
Flag = ;
break;
}
if(Flag) cout<<Jedi[i].Name<<endl;
}
} int main() {
#ifndef ONLINE_JUDGE
SetIO("C");
#endif
Input();
Solve();
return ;
}
ural 1218. Episode N-th: The Jedi Tournament的更多相关文章
- URAL 1218 Episode N-th: The Jedi Tournament(强连通分量)(缩点)
Episode N-th: The Jedi Tournament Time limit: 1.0 secondMemory limit: 64 MB Decided several Jedi Kni ...
- 1218. Episode N-th: The Jedi Tournament(bfs)
1218 简答题 对于当前点 判断每个点是否可达 #include <iostream> #include<cstdio> #include<cstring> #i ...
- URAL 2027 URCAPL, Episode 1 (模拟)
题意:给你一个HxW的矩阵,每个点是一个指令,根据指令进行一系列操作. 题解:模拟 #include<cstdio> #include<algorithm> using nam ...
- Educational Codeforces Round 13 E. Another Sith Tournament 概率dp+状压
题目链接: 题目 E. Another Sith Tournament time limit per test2.5 seconds memory limit per test256 megabyte ...
- Ural 1079 - Maximum
Consider the sequence of numbers ai, i = 0, 1, 2, …, which satisfies the following requirements: a0 ...
- Educational Codeforces Round 13 E. Another Sith Tournament 状压dp
E. Another Sith Tournament 题目连接: http://www.codeforces.com/contest/678/problem/E Description The rul ...
- URAL 1873. GOV Chronicles
唔 神题一道 大家感受一下 1873. GOV Chronicles Time limit: 0.5 secondMemory limit: 64 MB A chilly autumn night. ...
- Ural State University Internal Contest October'2000 Junior Session
POJ 上的一套水题,哈哈~~~,最后一题很恶心,不想写了~~~ Rope Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7 ...
- Codeforces CF#628 Education 8 A. Tennis Tournament
A. Tennis Tournament time limit per test 1 second memory limit per test 256 megabytes input standard ...
随机推荐
- Eclipse的模板设置代码
Eclipse Java注释模板设置详解 设置注释模板的入口: Window->Preference->Java->Code Style->Code Template 然后 ...
- java.sql.date与java.util.date区别以及数据库中插入带时分秒的时间
java.sql.Date,java.sql.Time和java.sql.Timestamp三个都是java.util.Date的子类(包装类). java.sql.Date是java.util.Da ...
- 用VMware安装虚拟系统时出现Invalid system disk,Replace the disk and then press any key
VMware 默认是第一次从光盘启动,第二次从硬盘启动,你刚分区,里面还没有系统,当然报这个错,再次从光盘启动需要设置 VMware 的 BIOS,重新启动虚拟系统,当出现 VMware 的图标时用鼠 ...
- 《ASP.NET MVC4 WEB编程》学习笔记------UrlHelper
HtmlHelper帮助我们生成Html标记代码:UrlHelper帮助我们生成URL链接地址 我们学习一下UrlHelper帮助类,看类名也都知道这个类是用来帮我们生成URL在ASP.NET MVC ...
- Android 和iOS 创建本地通知
1 Android 中的发送本地通知的逻辑如下 先实例化Notification.Builder,再用builder创建出具体的Notification,创建时要指定好启动用的PendingInten ...
- iOS tableView 选中某个cell时 标准的处理方法
以前选中cell时,常常判断选中的行数,但是当cell的顺序发生变化时,就要改动处理函数,特别是行数比较多的时候,很麻烦. 之后运用cell的title的内容判断,但是这种判断与现实的内容密切相关,如 ...
- ubuntu命令行相关命令使用心得
一.Ubuntu解压缩zip,tar,tar.gz,tar.bz2 ZIP zip可能是目前使用得最多的文档压缩格式.它最大的优点就是在不同的操作系统平台,比如Linux, Windows以及Mac ...
- 二、JavaScript语言--JS基础--JavaScript进阶篇--数组
1.什么事数组 我们知道变量用来存储数据,一个变量只能存储一个内容.假设你想存储10个人的姓名或者存储20个人的数学成绩,就需要10个或20个变量来存储,如果需要存储更多数据,那就会变的更麻烦.我们用 ...
- Android Bander设计与实现 - 设计篇
转自:http://blog.csdn.net/universus/article/details/6211589#t7 Binder Android IPC Linux 内核 驱动 摘要 Binde ...
- php 三元运算符使用说明和写法
PHP三元运算的2种写法代码实例 首先,我们现在看一个简单的例子: 代码如下: <?php //写法一: $a = 2; ($a == 1) ? $test = "我们" : ...