A. Beautiful Year time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output It seems like the year of 2013 came only yesterday. Do you know a curious fact? The year of 2013 is the first year after t
/** 题目:Confusing Date Format UVALive 7711 链接:https://vjudge.net/contest/174844#problem/A 题意:给定mm-mm-mm格式的时间.年份(1900-1999)只给了后两位数,问有多少种合法的排列使时间正确. 思路: 第一次:快速读题,题意不清,没注意到这句话, To punish teams who did not read this problem statement carefully, we’ll add
题目:809??=800*?+9*?+1其中?代表的两位数,8*?的结果为两位数,9*?的结果为3位数.求?代表的两位数,及809??后的结果 注意:一定要看清楚题目哦,809??代表的是结果,?代表两位数 a = 809 for i in range(10,100): b = a * i + 1 if b>=8090 and b<80900 and (8*i)<100 and (9*i)>99: #两种方式都可以 # if b>=1000 and b<=10000 a
include "stdafx.h" #include<iostream> #include<vector> #include <algorithm> #include<iomanip> #include<string> #include<numeric> #include<set> using namespace std; int toNum(int num, int i) { int sum = 0
As we all know that long2ip works as ip1.ip2.ip3.ip4 (123.131.231.212) long ip => (ip1 * 256 * 256 * 256) + (ip2 * 256 * 256) + (ip3 * 256) + ip4 2072242132 => (123 * 256 * 256 * 256) + (131 * 256 * 256) + (231 * 256) + 212 But what would be pseudo
比如a[]={2,4,5,6,7},得出的两组数{2,4,6}和{5,7},abs(sum(a1)-sum(a2))=0: 比如{2,5,6,10},abs(sum(2,10)-sum(5,6))=1,所以得出的两组数分别为{2,10}和{5,6}. vector<int> vct; int last = INT_MAX; int halfOfSum(int* arr, int len) { int sum = 0; for (int i = 0; i < len; ++i) { sum
题目大意是就是给出n个长度为7的字符串,每个字符串代表一个车,定义车的距离是两个字符串间不同字母的个数,题目要求的数不同的车的距离的最小值,即所求的就是最小生成树 Sample Input 4aaaaaaabaaaaaaabaaaaaaabaaaa0Sample Output The highest possible quality is 1/3. //输出 1/权值之和 prim # include <iostream> # include <cstdio> # include