题目传送:http://acm.hdu.edu.cn/showproblem.php?pid=6045 Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 687 Accepted Submission(s): 389 Problem Description Derek and Alfia are good friends.Derek …
题目链接 Problem Description Derek and Alfia are good friends.Derek is Chinese,and Alfia is Austrian.This summer holiday,they both participate in the summer camp of Borussia Dortmund.During the summer camp,there will be fan tests at intervals.The test co…
题目链接 可以暴力找一下规律 比如,假设N=7,两人有5题相同,2题不同,枚举X=0->15时,Y的"Not lying"的取值范围从而找出规律 #include<bits/stdc++.h> using namespace std; typedef long long LL; int T; int N,X,Y; string D,A; int main() { ios::sync_with_stdio(false); cin>>T; while(T--)…
题目网址:http://acm.hdu.edu.cn/showproblem.php?pid=6045 题目: Is Derek lying? Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 104 Accepted Submission(s): 65 Problem Description Derek and Alfia are…
Problem Description Derek and Alfia are good friends.Derek is Chinese,and Alfia is Austrian.This summer holiday,they both participate in the summer camp of Borussia Dortmund.During the summer camp,there will be fan tests at intervals.The test consist…
快速幂百度百科:快速幂就是快速算底数的n次幂.其时间复杂度为 O(log₂N), 与朴素的O(N)相比效率有了极大的提高. HDU - 1061 代码实现如下: import java.util.Scanner; public class Main { public static void main(String []args) { Scanner cin = new Scanner(System.in); int T = cin.nextInt(); for(int i = 0; i < T;…
First One Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 672 Accepted Submission(s): 193 Problem Description soda has an integer array a1,a2,-,an. Let S(i,j) be the sum of ai,ai+1,-,aj. N…
HDU1002:大数加法,PE了N次 import java.util.Scanner; import java.math.*; public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); int T; T=cin.nextInt(); for(int z=1;z<=T;z++) { if(z!=1) System.out.println(); BigInte…
一.题意 给出N个卡牌,卡牌的正反两面具有两个数字,取值范围为[1,2*n],给出若干个默认正面向上的卡牌,求最小反转多少张卡牌可以使得,每张卡牌朝上的面上都有一个不同的数字,同时满足最小反转次数的反转方法有多少个? Alice and Bob are playing a card game. In this card game, a number is written on each face of the playing card. The rule of the game is descr…
一.题意 好人必然说真话,坏人不一定说真话,给定N个人的言论<每人一个发言.不谈及自己>,要求指出有多少个人一定是好人,有多少个人一定是坏人.#define 狼人 坏人#define 村民 好人 The Werewolves" is a popular card game among young people.In the basic game, there are 2 different groups: the werewolves and the villagers.Each p…