随笔分类 - OJ
摘要:Barn RepairIt was a dark and stormy night that ripped the roof and gates off the stalls that hold Farmer John's cows. Happily, many of the cows were on vacation, so the barn was not completely full.The cows spend the night in stalls that are arranged adjacent to each other in a long line. Some s
阅读全文
摘要:Mixing MilkSince milk packaging is such a low margin business, it is important to keep the price of the raw product (milk) as low as possible. Help Merry Milk Makers get the milk they need in the cheapest possible manner.The Merry Milk Makers company has several farmers from which they may buy milk,
阅读全文
摘要:Dual PalindromesMario Cruz (Colombia) & Hugo Rickeboer (Argentina)A number that reads the same from right to left as when read from left to right is called a palindrome. The number 12321 is a palindrome; the number 77778 is not. Of course, palindromes have neither leading nor trailing zeroes, so
阅读全文
摘要:Palindromes are numbers that read the same forwards as backwards. The number 12321 is a typical palindrome.Given a number base B (2 <= B <= 20 base 10), print all the integers N (1 <= N <= 300 base 10) such that the square of N is palindromic when expressed in base B; also print the valu
阅读全文
摘要:View Code 1 /* 2 ID: qyxiang1 3 PROG: namenum 4 LANG: C++ 5 */ 6 #include <fstream> 7 #include<string> 8 #include<iostream> 9 #include<memory.h>10 #include<algorithm>11 12 using namespace std;13 14 ifstream fin("namenum.in");15 ofstream fout("namenum.out&
阅读全文
浙公网安备 33010602011771号