Problem 2282 Wand Accept: 432 Submit: 1537Time Limit: 1000 mSec Memory Limit : 262144 KB Problem Description N wizards are attending a meeting. Everyone has his own magic wand. N magic wands was put in a line, numbered from 1 to n(Wand_i owned…
Problem 1759 Super A^B mod C Accept: 1368 Submit: 4639Time Limit: 1000 mSec Memory Limit : 32768 KB Problem Description Given A,B,C, You should quickly calculate the result of A^B mod C. (1<=A,C<=1000000000,1<=B<=10^1000000). Input Th…
Problem 2107 Hua Rong Dao Accept: 503 Submit: 1054Time Limit: 1000 mSec Memory Limit : 32768 KB Problem Description Cao Cao was hunted down by thousands of enemy soldiers when he escaped from Hua Rong Dao. Assuming Hua Rong Dao is a narrow aisl…
Problem 2273 Triangles Accept: 201 Submit: 661Time Limit: 1000 mSec Memory Limit : 262144 KB Problem Description This is a simple problem. Given two triangles A and B, you should determine they are intersect, contain or disjoint. (Public edge o…
Problem D Game Accept: 145 Submit: 844Time Limit: 1000 mSec Memory Limit : 262144 KB Problem Description Alice and Bob is playing a game. Each of them has a number. Alice’s number is A, and Bob’s number is B. Each turn, one player can do one of…
Problem 2271 X Accept: 55 Submit: 200Time Limit: 1500 mSec Memory Limit : 32768 KB Problem Description X is a fully prosperous country, especially known for its complicated transportation networks. But recently, for the sake of better controlli…
N wizards are attending a meeting. Everyone has his own magic wand. N magic wands was put in a line, numbered from 1 to n(Wand_i owned by wizard_i). After the meeting, n wizards will take a wand one by one in the order of 1 to n. A boring wizard deci…
Problem 2111 Min Number Accept: 1025 Submit: 2022Time Limit: 1000 mSec Memory Limit : 32768 KB Problem Description Now you are given one non-negative integer n in 10-base notation, it will only contain digits ('0'-'9'). You are allowed to choos…
Problem 2082 过路费 Problem Description 有n座城市,由n-1条路相连通,使得任意两座城市之间可达.每条路有过路费,要交过路费才能通过.每条路的过路费经常会更新,现问你,当前情况下,从城市a到城市b最少要花多少过路费. Input 有多组样例,每组样例第一行输入两个正整数n,m(2 <= n<=50000,1<=m <= 50000),接下来n-1行,每行3个正整数a b c,(1 <= a,b <= n , a != b , 1…
Problem 1692 Key problem Accept: 103 Submit: 553 Time Limit: 1000 mSec Memory Limit : 32768 KB Problem Description Whenever rxw meets Coral, he requires her to give him the laboratory key. Coral does not want to give him the key, so Coral ask h…
题目链接:http://acm.fzu.edu.cn/problem.php?pid=2282 编号1~n的置换,不动点个数大于等于k的方案数. 参考百度百科错排公式,可以知道长度为n,每个数都不在自己位置的方案数.然后枚举长度即可. 考虑对立面(即小于k个在自己位置的)可以优化空间. #include<cstdio> #include<algorithm> using namespace std; ; ; int D[maxn]; ]; int F[maxn]; int main…
题目链接:https://vjudge.net/problem/FZU-2013 Problem 2013 A short problem Accept: 356 Submit: 1083Time Limit: 1000 mSec Memory Limit : 32768 KB Problem Description The description of this problem is very short. Now give you a string(length N), an…