ACM_STL题
LzyRapX
Just For Fun .
展开
-
NYOJ 366--D的小L【next_permutation水题】
D的小L时间限制:4000 ms | 内存限制:65535 KB难度:2描述 一天TC的匡匡找ACM的小L玩三国杀,但是这会小L忙着哩,不想和匡匡玩但又怕匡匡生气,这时小L给匡匡出了个题目想难倒匡匡(小L很D吧),有一个数n(0,,,聪明的你能帮匡匡解围吗?输入第一行输入一个数N(0输出按特定顺序输出所有组合。特定顺序:每一个组合中原创 2016-03-13 19:53:03 · 413 阅读 · 0 评论 -
Problem 26 Reciprocal cycles (模拟分数除法)
Reciprocal cyclesProblem 26A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given:1/2= 0.51/3原创 2016-10-28 23:51:34 · 488 阅读 · 0 评论 -
Problem 29 Distinct powers (set)
Distinct powersProblem 29Consider all integer combinations of ab for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5:22=4, 23=8, 24=16, 25=3232=9, 33=27, 34=81, 35=24342=16, 43=64, 44=256, 45=102452=25, 5原创 2016-10-29 10:38:14 · 488 阅读 · 2 评论 -
Problem 32 Pandigital products (暴力+set)
Pandigital productsProblem 32We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for example, the 5-digit number, 15234, is 1 through原创 2016-10-29 12:43:59 · 546 阅读 · 0 评论 -
HDU 1702 ACboy needs your help again! (模拟栈和队列)
ACboy needs your help again!Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5937 Accepted Submission(s): 3105Problem DescriptionACb原创 2016-10-19 17:11:05 · 403 阅读 · 0 评论 -
Problem 33 Digit cancelling fractions (暴力set+pair)
Digit cancelling fractionsProblem 33The fraction 49/98 is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that49/98 = 4/8, which原创 2016-10-29 20:59:38 · 655 阅读 · 0 评论 -
Problem 35 Circular primes (STL:rotate)
Circular primesProblem 35The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime.There are thirteen such primes below 100原创 2016-10-30 00:11:16 · 549 阅读 · 0 评论 -
Problem 38 Pandigital multiples (set + vector)
Pandigital multiplesProblem 38Take the number 192 and multiply it by each of 1, 2, and 3:192 × 1 = 192192 × 2 = 384192 × 3 = 576By concatenating each product we get the 1 to 9 pand原创 2016-10-30 00:16:52 · 456 阅读 · 0 评论 -
HDU 1716 排列2 (STL全排)
排列2Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7189 Accepted Submission(s): 2743Problem DescriptionRay又对数字的列产生了兴趣:现有四张卡片,用这四张原创 2016-10-19 21:21:36 · 497 阅读 · 0 评论 -
Problem 40 Champernowne's constant (暴力vector)
Champernowne's constantProblem 40An irrational decimal fraction is created by concatenating the positive integers:0.123456789101112131415161718192021...It can be seen that the 12th dig原创 2016-10-30 14:22:03 · 446 阅读 · 0 评论 -
Problem 41 Pandigital prime (暴力set+vector)
Pandigital primeProblem 41We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is a 4-digit pandigital and is also pri原创 2016-10-30 14:38:16 · 401 阅读 · 0 评论 -
Problem 42 Coded triangle numbers(ifstream +getline)
Coded triangle numbersProblem 42The nth term of the sequence of triangle numbers is given by, tn = ½n(n+1); so the first ten triangle numbers are:1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...原创 2016-10-30 15:19:17 · 372 阅读 · 0 评论 -
HDU 1896 Stones (优先队列)
StonesTime Limit: 5000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 2234 Accepted Submission(s): 1456Problem DescriptionBecause of the wrong stat原创 2016-10-20 20:53:30 · 964 阅读 · 0 评论 -
Problem 47 Distinct primes factors (分解因子)
Distinct primes factorsProblem 47The first two consecutive numbers to have two distinct prime factors are:14 = 2 × 715 = 3 × 5The first three consecutive numbers to have three distin原创 2016-10-31 19:53:12 · 786 阅读 · 0 评论 -
HDU 1022 Train Problem I (模拟栈)
Train Problem ITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 32386 Accepted Submission(s): 12221Problem DescriptionAs the new ter原创 2016-10-06 19:06:25 · 97 阅读 · 0 评论 -
Problem 24 Lexicographic permutations (全排列)
Lexicographic permutationsProblem 24A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutation原创 2016-10-28 13:52:18 · 825 阅读 · 1 评论 -
Problem 23 Non-abundant sums (盈数)
Non-abundant sumsProblem 23A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be原创 2016-10-28 13:42:15 · 527 阅读 · 1 评论 -
HDU 2115 I Love This Game(结构体排序 or pair)
I Love This GameTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7163 Accepted Submission(s): 2451Problem DescriptionDo you like p原创 2016-05-15 00:13:18 · 616 阅读 · 0 评论 -
2016"百度之星" - 资格赛(Astar Round1)Problem D(排序+map)
Problem DAccepts: 1443Submissions: 4107Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Problem Description度熊所居住的 D 国,是一个完全尊重人权的国度。以至于这个国家原创 2016-05-14 20:08:56 · 832 阅读 · 0 评论 -
全排列(next_permutation)
全排列。。。。#includeusing namespace std;int main(){ int n,p[10]; cin>>n; for(int i=0;i<n;i++) { cin>>p[i]; } sort(p,p+n); do { for(int i=0;i<n;i++) printf("%d ",p[i]); printf("\n");原创 2016-06-03 22:19:28 · 920 阅读 · 0 评论 -
Codeforces Round #362 (Div. 1) A. Lorenzo Von Matterhorn(map&LCA)
A. Lorenzo Von Matterhorntime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputBarney lives in NYC. NYC has infin原创 2016-08-17 18:40:30 · 400 阅读 · 0 评论 -
Codeforces Round #360 (Div. 1) A. NP-Hard Problem (二分图)
A. NP-Hard Problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently, Pari and Arya did some researc原创 2016-08-18 17:42:43 · 590 阅读 · 0 评论 -
Codeforces Round #333 (Div. 2) D. Lipshitz Sequence (单调栈)
D. Lipshitz Sequencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA function is called Lipschitz conti原创 2016-08-24 16:02:12 · 521 阅读 · 0 评论 -
HDU 2072 单词数 (STL:set)
单词数Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 45386 Accepted Submission(s): 11152Problem Descriptionlily的好朋友xiaoou333最近很空,他想了一原创 2016-09-16 15:55:16 · 491 阅读 · 0 评论 -
Codeforces Round #367 (Div. 2) D. Vasiliy's Multiset (multiset)
D. Vasiliy's Multisettime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAuthor has gone out of the stories ab原创 2016-08-13 12:59:33 · 812 阅读 · 0 评论 -
Codeforces Round #353 (Div. 2) C. Money Transfers (map)
C. Money Transferstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n banks in the city where Vasya原创 2016-09-04 16:36:20 · 559 阅读 · 0 评论 -
HDU 2094 产生冠军 (map)
产生冠军Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 14754 Accepted Submission(s): 6752Problem Description有一群人,打乒乓球比赛,两两捉对撕杀,每两个人之间最原创 2016-09-16 23:09:04 · 576 阅读 · 0 评论 -
HDU 1228 A + B (map)
A + BTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15544 Accepted Submission(s): 9273Problem Description读入两个小于100的正整数A和B,计算A+B.原创 2016-10-12 21:22:15 · 434 阅读 · 0 评论 -
HDU 5908 Abelian Period (暴力+map)
Abelian PeriodTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/131072 K (Java/Others)Total Submission(s): 734 Accepted Submission(s): 295Problem DescriptionLet S be a原创 2016-10-14 19:21:51 · 725 阅读 · 0 评论 -
HDU 1361 Parencodings (模拟)
ParencodingsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 913 Accepted Submission(s): 541Problem DescriptionLet S = s1 s2 … s2n b原创 2016-10-17 23:24:56 · 527 阅读 · 0 评论 -
Problem 49 Prime permutations (set + vector)
Prime permutationsProblem 49The arithmetic sequence, 1487, 4817, 8147, in which each of the terms increases by 3330, is unusual in two ways: (i) each of the three terms are prime, and, (ii原创 2016-10-31 19:56:50 · 375 阅读 · 0 评论