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 ...
随机推荐
- Poj 3233 Matrix Power Series(矩阵二分快速幂)
题目链接:http://poj.org/problem?id=3233 解题报告:输入一个边长为n的矩阵A,然后输入一个k,要你求A + A^2 + A^3 + A^4 + A^5.......A^k ...
- HDU 4435 charge-station bfs图论问题
E - charge-station Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u ...
- Linux 怎么查看服务的启动进程所占用的目录
lsof简介 lsof(list open files)是一个列出当前系统打开文件的工具.在linux环境下,任何事物都以文件的形式存在,通过文件不仅仅可以访问常规数据,还可以访问网络连接和硬件.所以 ...
- android dialog 模拟新浪、腾讯title弹框效果
http://blog.csdn.net/jj120522/article/details/7764183 首先我们看一下新浪微博的效果(其它就是一个dialog): 点 ...
- http协议学习系列
深入理解HTTP协议(转) http://www.blogjava.net/zjusuyong/articles/304788.html http协议学习系列 1. 基础概念篇 1.1 介绍 H ...
- iOS 关于Layer的疑问
很久很久以前,就对ios的Layer十分的不解,学习了android后,打算通过android中的相关实现,分析一下ios中layer的作用,结果没有找到android中的对应的内容!十分让人郁闷.于 ...
- C++语法 初始化列表 数组引用
只能在初始化列表initilizationlist中初始化的有: 1.const修饰的数据成员或者reference参考 2.基类的构造函数 注意,数组不能引用,亦即以下代码是不对的 void fun ...
- OSG 初始化为非全屏窗口
OSG默认的窗口时全屏的,调试的时候不方便. 在网上看到一段代码,可以非全屏显示 int _tmain(int argc, _TCHAR* argv[]){ osgViewer::Viewer vie ...
- php5.4.3连接SQLite3
我使用的是WAMP2.2菜单-PHP-PHP extensions勾选php_sqlite3<?php$conn = new SQLite3("c:/wamp/www/test.db& ...
- 网络流-最大流 模板(poj 1273)
#include<cstdio> #include<iostream> #include<cstring> #include<queue> #defin ...