hihoCoder Challenge 14 register

Ended

Participants:709

Verdict:Accepted
Submitted:2015-08-30 19:33:58

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string.h>
#include <queue>
#include <stack> 
#include <map>
using namespace std;
const int MAXN=105;
struct node{
    int t,c;
}a[MAXN];
bool ok(int x,int k){
    int t=a[k].t,c=a[k].c;
    if (t==1) return x<c; 
    if (t==2) return x==c;
    if (t==3) return x>c;
    if (t==4) return x<=c; 
    if (t==5) return x>=c; 
    return false;
}
char s[1005];
int main(){    
    int n;
    while (~scanf("%d",&n)){
        for (int i=1;i<=n;i++){
            scanf("%s%s%d",s,s,&a[i].c),a[i].c*=2;
            if (strlen(s)==1){
                if (s[0]=='<') a[i].t=1; else
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX