git reimport
This commit is contained in:
39
archive/2019.03/2019.03.14 - Yandex.Interview/C.java
Normal file
39
archive/2019.03/2019.03.14 - Yandex.Interview/C.java
Normal file
@@ -0,0 +1,39 @@
|
||||
package chelper;
|
||||
|
||||
import io.InputReader;
|
||||
import io.OutputWriter;
|
||||
import solutions.ChelperSolution;
|
||||
|
||||
|
||||
public class C extends ChelperSolution {
|
||||
|
||||
@Override
|
||||
public void solve(int testNumber, InputReader in, OutputWriter out) {
|
||||
super.solve(testNumber, in, out);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void solve(int testNumber) {
|
||||
int n = in.nextInt();
|
||||
|
||||
int prev = 0;
|
||||
boolean first = true;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (i % 100000 == 0) {
|
||||
System.gc();
|
||||
}
|
||||
|
||||
int cur = in.nextInt();
|
||||
|
||||
if (!first && cur == prev) {
|
||||
continue;
|
||||
}
|
||||
|
||||
out.println(cur);
|
||||
|
||||
first = false;
|
||||
prev = cur;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user