Submission #2237200
Source Code Expand
import std.stdio; import std.array; import std.conv; import std.algorithm; struct Reader { char[][] inputs; ulong idx; bool nextLine() { char[] buf; if(readln(buf)==0) return 0; inputs=split(buf); idx=0; return 1; } char[] nextItem() { if(idx==inputs.length) { nextLine(); idx=0; } return inputs[idx++]; } int nxtInt() { return to!int(nextItem()); } double nxtDouble() { return to!double(nextItem()); } char[] nxtStr() { return nextItem(); } } void main() { Reader r; int N=r.nxtInt(); int[] a; for(int i=0;i<N;i++) a~=r.nxtInt(); a.length-=a.sort.uniq.copy(a).length; writeln(a.length); }
Submission Info
Submission Time | |
---|---|
Task | B - Kagami Mochi |
User | Div9851 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 811 Byte |
Status | CE |
Compile Error
./Main.cpp:1:1: error: ‘import’ does not name a type import std.stdio; ^ ./Main.cpp:2:1: error: ‘import’ does not name a type import std.array; ^ ./Main.cpp:3:1: error: ‘import’ does not name a type import std.conv; ^ ./Main.cpp:4:1: error: ‘import’ does not name a type import std.algorithm; ^ ./Main.cpp:6:9: error: expected unqualified-id before ‘[’ token char[][] inputs; ^ ./Main.cpp:7:5: error: ‘ulong’ does not name a type ulong idx; ^ ./Main.cpp:15:9: error: expected unqualified-id before ‘[’ token char[] nextItem() { ^ ./Main.cpp:39:1: error: expected ‘}’ at end of input } ^ ./Main.cpp: In member function ‘bool Reader::nextLine()’: ./Main.cpp:9:13: error: expected unqualified-id before ‘[’ token char[] buf; ^ ./Main.cpp:10:19: error: ‘buf’ was not declared in this scope if(readln(buf)==0) return 0; ^ ./Main.cpp:10:22: error: ‘readln’ was not declared in this scope if(readln(buf)==0) return ...