zoukankan      html  css  js  c++  java
  • 图博弈

    http://codeforces.com/gym/100889/problem/E

    题意:给出n个点m条有向边,有向简单图,问jorah能否走到n节点,对手可以移除任意一边。

    解法:只有jorah一步走到n节点才可能赢。

    #include<cstdio>
    #include<cmath>
    #include<map>
    #include<cstring>
    #include <iostream>
    #include<algorithm>
    using namespace std;
    const int MAX = 1e5 + 10;
    typedef long long LL;
    LL a[100009];
    
    int main()
    {
        int  t ;
        cin >> t ;
        while(t--)
        {
            int n , m , flag = 0 ;
            cin >> n >> m ;
            for(int i = 0 ; i < m ; i++)
            {
                int u , v ;
                scanf("%d%d" , &u , &v);
                if(u == 1 && v == n)
                    flag = 1 ;
            }
            if(flag)
                cout << "Jorah Mormont" << endl ;
            else
                cout << "Khal Drogo" << endl ;
    
        }
    
        return 0;
    }
  • 相关阅读:
    12.10
    4.06Android使用EditText小技巧汇总
    4.05
    4.04Android学习
    4.03Android学习
    4.02Android学习
    4.01Android学习
    3.31构建之法读后感3
    3.30Android学习
    3.29Android学习
  • 原文地址:https://www.cnblogs.com/nonames/p/11311513.html
Copyright © 2011-2022 走看看