懒得复制,戳我戳我 Solution: 我感觉我也说不太好,看Awson的题解吧. 说一点之前打错的地方: 连边存的是hash后的数组下标 if(ans[ num( C[a.hash()] , C[b.hash()] ) ]==1){ if(f==0)printf("Alice\n");else printf("Bob\n"); continue; } if(ans[ num( C[a.hash()] , C[b.hash()] ) ]==-1){ if(f==0)…
  Imagine that Alice is playing a card game with her friend Bob. They both have exactly 88 cards and there is an integer on each card, ranging from 00 to 44. In each round, Alice or Bob in turns choose two cards from different players, let them be aa…
C. Mail Stamps Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/problemset/problem/29/C Description One day Bob got a letter in an envelope. Bob knows that when Berland's post officers send a letter directly from city «A» to city «B…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2647 Problem Description Dandelion's uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he has a trouble about how to distribute the rewar…
传送门 •题意 给你两个数组 p,q ,分别存放 1~n 的某个全排列: 让你根据这两个数组构造一个字符串 S,要求: (1)$\forall i \in [1,n-1],S_{pi}\leq S _{pi+1}  ,\forall i \in [1,n-1],S_{qi} \leq S _{qi+1}$ (2)字符串 S 至少包含 k 个不同的小写字母: •思路 类似于牛客第五场的H 不过由于这个不知道字母是什么,需要利用强联通分解, 把属于同一个强联通块的位置置于同一个字母, 然后根据前后关…
Description 题库链接 两个人 Van♂ 游戏,每人手上各有 \(8\) 张牌,牌上数字均为 \([0,4]\) 之间的数.每个人在自己的回合选自己手牌中数字不为 \(0\) 的一张与对方手牌中不为 \(0\) 的一张.数字相加对 \(5\) 取模,赋给自己当前选中的这张牌. \(T\) 组询问,给出先手,问谁能胜. \(1\leq T\leq 100000\) Solution 首先注意到卡牌顺序是没有影响的,我们可以按数字大小排序.这时由可重复的组合得每个人可能的方案只有 \(\b…
转自大佬博客:https://www.cnblogs.com/NaVi-Awson/p/8405966.html; 题意 两个人 Van♂ 游戏,每人手上各有 8'>88 张牌,牌上数字均为 [0,4]'>[0,4][0,4] 之间的数.每个人在自己的回合选自己手牌中数字不为 0'>00的一张与对方手牌中不为 0'>00 的一张.数字相加对 5'>55 取模,赋给自己当前选中的这张牌. T'>TT 组询问,给出先手,问谁能胜. 分析 首先注意到卡牌顺序是没有影响的,我们…
题目链接:http://codeforces.com/problemset/problem/510/C Fox Ciel is going to publish a paper on FOCS (Foxes Operated Computer Systems, pronounce: "Fox"). She heard a rumor: the authors list on the paper is always sorted in the lexicographical order.…
E. Minimal Labels time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given a directed acyclic graph with n vertices and m edges. There are no self-loops or multiple edges between any p…
题目链接:https://hihocoder.com/problemset/problem/1343 #1343 : Stable Members 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Recently Little Hi joined an algorithm learning group. The group consists of one algorithm master and N members. The members are numbered…