比赛链接 A题 -- Enter your code here. Read input from STDIN. Print output to STDOUT main = do x <- getLine y <- getLine putStrLn $ reverse $ foldl (\acc (x, y) -> [y]++[x]++acc) [] $ zip x y B题 1 -- Enter your code here. Read input from STDIN. Print o…
题目链接:https://vjudge.net/contest/187496#problem/E E Excellent Engineers You are working for an agency that selects the best software engineers from Belgium, the Netherlands and Luxembourg for employment at various international companies. Given the ve…
Java 8 发布带来的一个主要特性就是对函数式编程的支持. 而 Lambda 表达式就是一个新的并且很重要的一个概念. 它提供了一个简单并且很简洁的编码方式. 首先从几个简单的 Lambda 表达式的例子开始了解 Java 中的函数式编程. Lambda 表达式初识: 首先定义一个 Lambda 表达式: x -> x + 1 这个表达式输入参数是一个 x,然后对这个参数 x 的操作是加 1,然后将这个结果返回,即返回值. 从这个简单的 Lambda 表达式可以看出 Lambda 表达式的语法…
F. Contestants Ranking time limit per test:1 second memory limit per test:24 megabytes input:standard input output:standard output Ahmad is one of the best students in HIAST, and also a very good problems Solver. In the time you will spend reading th…
我是铁牌选手 这次比赛非常得爆炸,可以说体验极差,是这辈子自己最脑残的事情之一. 天时,地利,人和一样没有,而且自己早早地就想好了甩锅的套路. 按理说不开K就不会这么惨了啊,而且自己也是毒,不知道段错误也可以是MLE,而且我的内存就是卡了那么一点点,在比赛紧张的状态下人也变傻了吧. 这次的题目难度是两边到中间一次递增的,但是我也不懂榜怎么会那样  A Peak Time Limit: 1 Second      Memory Limit: 65536 KB A sequence of  inte…
Problem G Galactic Collegiate Programming Contest 这个题题意读了一会,就是几个队参加比赛,根据实时的信息,问你1号队的实时排名(题数和罚时相同的时候并列). 暴力模拟,简直要模拟死了...有个地方感觉很有意思,就是如果某个队还一道题都没写出来的话根本就不用和1队比较,这里用一个数组存一下出题数大于等于1的队伍,直接比较这些队伍就可以,如果全都比较一遍就会超时,真的,相信我. 代码: 1 #include<iostream> 2 #include…
    Programming Contest Problem Types Hal Burch conducted an analysis over spring break of 1999 and made an amazing discovery: there are only 16 types of programming contest problems! Furthermore, the top several comprise almost 80% of the problems s…
1. Functional programming treats computation as the evaluation of mathematical and avoids state and mutable data. Scala encourages an expression-oriented programming(EOP) 1) In expression-oriented programming every statement is an expression. A state…
Lifting Now, let's review map from another perspective. map :: (T -> R) -> [T] -> [R] accepts 2 parameters, a function f :: T -> R and a list list :: [T]. [T] is a generic type paramterized by T, it's not the same as T, but definitely shares s…
Functions in Java Prior to the introduction of Lambda Expressions feature in version 8, Java had long been known as a purely object-oriented programming language. "Everything is an Object" is the philosophy deep in the language design. Objects a…