チャレンジ
あなたの目標は、イベントのリスト(アップ投票、ダウン投票など)を取得し、ユーザーの評判と彼が獲得した特権を返す最短のプログラムを作成することです。
どんなイベント?
以下は、獲得した評判の順にリストされたイベントのチャートです。
-15 answer unaccepted
-10 answer unupvoted
-5 question unupvoted
-2 answer downvoted
-2 question downvoted
-2 unaccept answer
-1 downvote answer
+1 join website
+1 undownvote answer
+2 accept answer
+2 question undownvoted
+2 answer undownvoted
+5 question upvoted
+10 answer upvoted
+15 answer accepted
+100 association bonus
どんな特権ですか?
権限のリストを、必要な評価の順に示します。
1 create posts
5 participate in meta
10 remove new user restrictions
10 create wiki posts
15 vote up
15 flag posts
20 talk in chat
50 comment everywhere
75 set bounties
100 edit community wiki
100 create chat rooms
125 vote down
150 create tags
200 retag questions
250 view close votes
500 cast close and reopen votes
750 established user
1000 edit questions and answers
1000 create gallery chat rooms
1250 create tag synonyms
1500 approve tag wiki edits
2000 access to moderator tools
3500 protect questions
4000 trusted user
入力
(STDINでの)入力は、イベントのリストであり、1行に1つずつ、最初のチャートでの正確な表示方法(評判の量を除く)になります。空白行は入力の終わりを表します。次に例を示します(最後に空白行が必要です)。
join website
association bonus
answer upvoted
answer upvoted
question upvoted
answer accepted
answer upvoted
accept answer
unaccept answer
question unupvoted
accept answer
question upvoted
出力
出力の最初の行(STDOUTへ)には、累積されたrepの量を指定する必要があります。その後の各行には、獲得した1つの特権が、表示されているとおりに、2番目のチャートと同じ順序でリストされます。上記の入力に対して予想される出力:
153 reputation
1 create posts
5 participate in meta
10 remove new user restrictions
10 create wiki posts
15 vote up
15 flag posts
20 talk in chat
50 comment everywhere
75 set bounties
100 edit community wiki
100 create chat rooms
125 vote down
150 create tags
ルール、制限、および注意
これはコードゴルフです。標準コードのゴルフ規則が適用されます。
(編集:ファイルにアクセスするエントリが2つあるため、コードゴルフの標準ルールの一部としてファイルの長さをコード長に追加する必要があることを指摘したい