We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 72b5b18 commit 7840f16Copy full SHA for 7840f16
swift/sample_problem.swift
@@ -0,0 +1,23 @@
1
+import Foundation
2
+
3
+let T = Int(readLine()!)!
4
5
+for ti in 1 ... T {
6
+ let line = readLine()!.components(separatedBy: " ")
7
8
+ let N = Int(line[0])!
9
10
+ let M = Int(line[1])!
11
12
+ let C = readLine()!.components(separatedBy: " ").map { Int($0)! }
13
14
+ var sum = 0
15
16
+ for Ci in C {
17
+ sum += Ci
18
+ }
19
20
+ let modulo = sum % M
21
22
+ print("Case #\(ti): \(modulo)")
23
+}
tests/sample_problem.in
@@ -0,0 +1,5 @@
+2
+7 3
+1 2 3 4 5 6 7
+5 10
+7 7 7 7 7
0 commit comments