BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / cpp / #85631同步于 2015/2/12
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖

这几个题怎么做啊

F98
2015/2/12镜像同步1 回复
Mission 1: Write a program which fulfills the requirements below Description We want to calculate a sum of squares of some integers, excepting negatives The first line of the input will be an integer N (1 <= N <= 100) Each of the following N test cases consists of one line containing an integer X (0 < X <= 100), followed by X integers (Yn, -100 <= Yn <= 100) space-separated on the next line For each test case, calculate the sum of squares of the integers excepting negatives, and print the calculated sum to the output. No blank line between test cases (Take input from standard input, and output to standard output) Rules Write it in Go Programming Language Your source code must be a single file (package main) Do not use for statement You may only use standard library packages Sample Input 2 4 3 -1 1 14 5 9 6 -53 32 16 Sample Output 206 1397 Mission 2: Publish your source code as a secret gist Description Publish your source code as a secret gist. You will need a GitHub account to create a secret gist. If you're not familiar with "secret gist"s, follow the instruction here. Please make sure not to publish it as a public gist. We will take a look at your source code later, after you achieve Mission 3. Your program will be auto-tested, so please be strict about the input/output. Mission 3: Send us the URL of your work Description First, construct a JSON string like below: { "github_url": "https://gist.github.com/YOUR_ACCOUNT/GIST_ID", "contact_email": "EMAIL" } (Fill in your email address for "EMAIL", and the path to your secret gist for "YOUR_ACCOUNT/GIST_ID". Be sure you've double-checked your email address; we will contact you by email.) Then, make an HTTP POST request to the URL http://hdechallenge-solve.appspot.com/challenge/003/endpoint which contains the JSON string as a body part. Content-Type: of the request must be "application/json". The URL is protected by HTTP Basic Authentication, which is explained on Chapter 2 of RFC2617, so you have to provide an Authorization: header field in your POST request For the "userid" of HTTP Basic Authentication, use the same email address you put in the JSON string. For the "password", provide an 10-digit time-based one time password conforming to RFC6238 TOTP. You have to read RFC6238 (and the errata too!) and get a correct one time password by yourself. TOTP's "Time Step X" is 30 seconds. "T0" is 0. Use HMAC-SHA-512 for the hash function, instead of the default HMAC-SHA-1. Token shared secret is the userid followed by ASCII string value "HDECHALLENGE003" (not including double quotations). For example, if the userid is "ninja@example.com", the token shared secret is "ninja@example.comHDECHALLENGE003". For example, if the userid is "ninjasamuraisumotorishogun@example.com", the token shared secret is "ninjasamuraisumotorishogun@example.comHDECHALLENGE003" If your POST request succeeds, the server returns HTTP status code 200. Rules You don't have to disclose how you achieved this mission at this time. Don't hesitate to use source codes or tools on the net (but do the exploring process by yourself of course, don't ask your friend to help you). Go ahead with your nasty hacks! No bruteforce attacks, please! Sample Request POST /challenge/003/endpoint HTTP/1.1 Authorization: Basic bmluamFAZXhhbXBsZS5jb206MTc3MzEzMzI1MA== Host: admissionchallenge.example.com Accept: */* Content-Type: application/json Content-Length: 104 {"contact_email":"ninja@example.com", "github_url":"https://gist.github.com/hde/b859bd12e7a7fb418141"} Sample Response HTTP/1.1 200 OK Content-Type: text/html; charset=utf-8 Date: Mon, 17 Mar 2014 15:20:51 GMT Transfer-Encoding: chunked Congratulations! You have achieved mission 3. (TicketID:390c1a5b7507c227)
订阅后,新回复会通过你的通知中心匿名送达。
1 条回复
shuizhihan机器人#1 · 2015/2/22
不懂,BD。 Don't hesitate to use source codes or tools on the net (but do the exploring process by yourself of course, don't ask your friend to help you). 来自「北邮人论坛手机版」