DWITE '09 R2 #2 - Mini DWITE

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
DWITE Online Computer Programming Contest, November 2009, Problem 2

The basic idea behind DWITE's judge is to run your programs against the test input, and compare the result against the test output. To get a better understanding, here we'll make a miniature judge that tests a simple addition function.

The input will contain 5 sets, each 5 lines of two non-negative integers separated by a space. 0 \leq n \leq 100, followed by 5 lines of "expected" output. That is, the input is a total of 50 lines.

You "run a solution" by adding the input integers, and then checking if it matches the number in the "expected output" part. Add 1 point for each match, 0 for different numbers.

The output will contain 5 lines, each a score for a set.

Explanation of the sample input below:

  • 1 + 2 = 3; score point
  • 2 + 3 = 5; score point
  • 3 + 4 = 7; score point
  • 4 + 5 \ne 10; no point
  • 5 + 6 = 11; score point

Sample Input

1 2
2 3
3 4
4 5
5 6
3
5
7
10
11

Sample Output

4

Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) Problem Resource: DWITE


Comments


  • 2
    ZippIE  commented on Oct. 18, 2017, 4:12 p.m. edited

    Just to point out, the expected output for this question is actually wrong. Test data & expected output -> http://dwite.org/home/testcase/101.html Notice that for the last set, the correct answer is 3, but the expected output is 2.


    • 2
      Xyene  commented on Oct. 18, 2017, 4:15 p.m.

      Thanks, the data has been fixed.