比赛链接

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 output to STDOUT
2 import Data.List
3 main = do
4 inputdata <- getLine
5 putStrLn . concat . map (\xs -> f (head xs) (length xs)) . group $ inputdata
6 where
7 f ch len
8 | len == 1 = [ch]
9 | otherwise = [ch] ++ show len

C题

 -- Enter your code here. Read input from STDIN. Print output to STDOUT
import Data.Char
main::IO ()
main = getContents >>= print . (\[n, k] -> superDigit ((read k) * getStrSum(n))) . words superDigit::Int -> Int
superDigit n
| n < 10 = n
| otherwise = superDigit . getSum $ n getSum::Int -> Int
getSum 0 = 0
getSum n = (n `rem` 10) + getSum ( n `div` 10) getStrSum::String -> Int
getStrSum [] = 0
getStrSum (x:xs) = ord x - ord '' + getStrSum xs

D题

E题

Functional Programming Contest - September'14的更多相关文章

  1. 2014 Benelux Algorithm Programming Contest (BAPC 14)E

    题目链接:https://vjudge.net/contest/187496#problem/E E Excellent Engineers You are working for an agency ...

  2. Java 中的函数式编程(Functional Programming):Lambda 初识

    Java 8 发布带来的一个主要特性就是对函数式编程的支持. 而 Lambda 表达式就是一个新的并且很重要的一个概念. 它提供了一个简单并且很简洁的编码方式. 首先从几个简单的 Lambda 表达式 ...

  3. Gym 100952F&&2015 HIAST Collegiate Programming Contest F. Contestants Ranking【BFS+STL乱搞(map+vector)+优先队列】

    F. Contestants Ranking time limit per test:1 second memory limit per test:24 megabytes input:standar ...

  4. 2018浙江省赛(ACM) The 15th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple

    我是铁牌选手 这次比赛非常得爆炸,可以说体验极差,是这辈子自己最脑残的事情之一. 天时,地利,人和一样没有,而且自己早早地就想好了甩锅的套路. 按理说不开K就不会这么惨了啊,而且自己也是毒,不知道段错 ...

  5. Codeforces Gym101572 G.Galactic Collegiate Programming Contest (2017-2018 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2017))

    Problem G Galactic Collegiate Programming Contest 这个题题意读了一会,就是几个队参加比赛,根据实时的信息,问你1号队的实时排名(题数和罚时相同的时候并 ...

  6. Programming Contest Problem Types

        Programming Contest Problem Types Hal Burch conducted an analysis over spring break of 1999 and ...

  7. Beginning Scala study note(4) Functional Programming in Scala

    1. Functional programming treats computation as the evaluation of mathematical and avoids state and ...

  8. Functional Programming without Lambda - Part 2 Lifting, Functor, Monad

    Lifting Now, let's review map from another perspective. map :: (T -> R) -> [T] -> [R] accep ...

  9. Functional Programming without Lambda - Part 1 Functional Composition

    Functions in Java Prior to the introduction of Lambda Expressions feature in version 8, Java had lon ...

随机推荐

  1. Luogu P2484 [SDOI2011]打地鼠(模拟+前缀和)

    P2484 [SDOI2011]打地鼠 题意 题目描述 打地鼠是这样的一个游戏:地面上有一些地鼠洞,地鼠们会不时从洞里探出头来很短时间后又缩回洞中.玩家的目标是在地鼠伸出头时,用锤子砸其头部,砸到的地 ...

  2. css过渡属性transition简单示例

    2.transition 简单实例 demo1→在线预览源代码 效果 demo2→在线预览源代码 效果 demo3→在线预览源代码 效果

  3. JS 作用域、原型链

    看到一道好题,并附答案 function Foo() { getName = function () { console.log('1'); }; return this; } Foo.getName ...

  4. windows IIS 部署dotnetcore

    1.安装windows IIS 程序 ,详细过程略. 2.下载dotnet core SDK runtime 链接地址:https://dotnet.microsoft.com/download/th ...

  5. 我眼中javascript的这些年

    写了两年多的js了吧,一开始的目标并没有很学术,我只想安安静静做个很厉害的开发者.但是总是沉溺在一种语言里,会让人误以为这种语言很厉害,就像只在村子里混的话,我觉得我自己可以逆天,村外有人,编程世界也 ...

  6. ROC曲线及AUC

    ROC曲线 意义 ROC曲线指受试者工作特征曲线 / 接收器操作特性曲线(receiver operating characteristic curve),是反映敏感性和特异性连续变量的综合指标,是用 ...

  7. HTML 项目符号

    无序符号 <ul> <li> </li> <li> </li> <li> </li> </ul> 属性 ...

  8. Chapter 3 树与二叉树

    Chapter 3 树与二叉树 1-   二叉树 主要性质: 1   叶子结点数 = 度为2的结点数 + 1   2   二叉树第i层上最多有 (i≥1)个结点 3   深度为k的二叉树最多有 个结点 ...

  9. hive新加入字段插入数据需要注意事项

    hive中新加字段需要注意如下 1)如果表中有分区字段,必须先删除分区才能插入数据否则为null; 2)insert override TABLE table1 select counm1,counm ...

  10. net.sf.json JSONObject与JSONArray总结

    JSONObject:json对象,就是一个键对应一个值,使用的是大括号{ },如:{key:value} JSONArray:json数组,使用中括号[ ],只不过数组里面的项也是json键值对格式 ...