Beautiful numbers
Time Limit:4000MS Memory Limit:262144KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
Volodya is an odd boy and his taste is strange as well. It ...
分类:
其他好文 时间:
2015-01-21 15:18:19
阅读次数:
189
D. New Year Santa Network
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
New Year is coming in Tree World! In this w...
分类:
Web程序 时间:
2015-01-20 22:21:52
阅读次数:
366
For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decre...
分类:
其他好文 时间:
2015-01-20 08:58:38
阅读次数:
231
main() { char s[30]; strcpy(s, "Good News!"); /*给数组赋字符串*/ . . . } 上面程序在编译时, 遇到char s[30]这条语句时, 编译程序会在内存的某处留 出连续30个字节的区域, 并将第一个字节的地址赋给s。当遇到strcpy( strc...
分类:
编程语言 时间:
2015-01-19 14:09:15
阅读次数:
214
我要翻译题目!!!/*A group of cows grabbed a truck and ventured on anexpeditiondeep into the jungle. Being rather poor drivers, the cows unfortunately managed...
分类:
编程语言 时间:
2015-01-18 19:41:57
阅读次数:
394
要求
编写一段程序,可以自动生成小诗。
格式如下
源码
import random
import sys
articles = ["the", "a", "another", "her", "his"]
subjects = ["cat", "dog", "horse", "man", "woman", "boy", "girl"]
verbs =...
分类:
编程语言 时间:
2015-01-18 15:47:58
阅读次数:
242
题目中说每一个good pair 都满足(u+v)%2 == 1,即一个奇数,一个偶数。
首先我们要拿出一原点S,汇点T,S联到所有的num[odd]的质因子上,T联到所有的num[even]的质因子上,边的流量为num[i]中相应质因子的个数。
再根据给出的,假设u为奇数,则从u的质因子上联到相等的v的质因子上,流量为INF。
丢到模板里跑一遍就好了。
#include
#includ...
分类:
其他好文 时间:
2015-01-17 16:38:05
阅读次数:
190
1. 数组#!/usr/bin/perlmy $str = "hello,nihao,no,o,good";my @arr = split(/,/, $str);print "len:" . @arr . "\n";for (my $i=0; $i >text.txt")用追加,不要用>,>会清空原...
分类:
其他好文 时间:
2015-01-17 15:12:49
阅读次数:
142
题目连接:请戳这里。
题目大意及思路:就是找学生最多的那个集合。注意一点的是“or there is only one boy left.”#include
#include
#include
#include
#include
#include
#define N 10000000+10
using namespace std;
int f[N],num[N];
void Init(int ...
分类:
其他好文 时间:
2015-01-17 11:17:07
阅读次数:
131
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
click to show spoilers.
Have you thought about this?
Here are some good questions to ask before c...
分类:
其他好文 时间:
2015-01-15 22:06:26
阅读次数:
132