| Task: | Pile |
| Sender: | PILIPOJAT!! |
| Submission time: | 2016-10-04 18:15:42 +0300 |
| Language: | Java |
| Status: | READY |
| Result: | ACCEPTED |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.20 s | details |
| #2 | ACCEPTED | 0.18 s | details |
| #3 | ACCEPTED | 0.23 s | details |
| #4 | ACCEPTED | 0.18 s | details |
| #5 | ACCEPTED | 0.18 s | details |
| #6 | ACCEPTED | 0.20 s | details |
| #7 | ACCEPTED | 0.18 s | details |
| #8 | ACCEPTED | 0.18 s | details |
| #9 | ACCEPTED | 0.15 s | details |
| #10 | ACCEPTED | 0.16 s | details |
| #11 | ACCEPTED | 0.18 s | details |
| #12 | ACCEPTED | 0.15 s | details |
| #13 | ACCEPTED | 0.19 s | details |
| #14 | ACCEPTED | 0.17 s | details |
| #15 | ACCEPTED | 0.19 s | details |
| #16 | ACCEPTED | 0.16 s | details |
| #17 | ACCEPTED | 0.17 s | details |
| #18 | ACCEPTED | 0.23 s | details |
| #19 | ACCEPTED | 0.15 s | details |
| #20 | ACCEPTED | 0.17 s | details |
| #21 | ACCEPTED | 0.19 s | details |
| #22 | ACCEPTED | 0.19 s | details |
| #23 | ACCEPTED | 0.21 s | details |
| #24 | ACCEPTED | 0.20 s | details |
| #25 | ACCEPTED | 0.17 s | details |
| #26 | ACCEPTED | 0.18 s | details |
| #27 | ACCEPTED | 0.22 s | details |
| #28 | ACCEPTED | 0.12 s | details |
| #29 | ACCEPTED | 0.20 s | details |
| #30 | ACCEPTED | 0.17 s | details |
Code
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
//package cses5teht;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
/**
*
* @author eamiller
*/
public class Cses5teht {
public static void main(String[] args) {
IO io = new IO();
int n = io.nextInt();
int[] taul = new int[n];
for(int i=0; i<taul.length; i++) {
taul[i] = io.nextInt();
}
if(taul.length <= 2) {
System.out.println("Not a proof");
return;
}
/*
//hc koodi
int pienin;
for(int i=0; i<taul.length; i=asd(i)) {
pienin = taul[i+1];
for(int j = i+2; j<taul.length; j++) {
if(taul[i]>taul[j] && pienin < taul[j]) {
System.out.println("Cheater");
return;
} else if(taul[i]<taul[j]) {
i=j;
j++;
pienin = taul[i+1];
} else if(taul[i]<pienin) pienin = taul[i];
}
}
System.out.println("Not a proof");*/
//vähä enemmän hc koodi
int pienin;
int i=0;
pienin = taul[i+1];
for(int j = i+2; j<taul.length; j++) {
if(taul[i]>taul[j] && pienin < taul[j]) {
System.out.println("Cheater");
return;
} else if(taul[i]<taul[j]) {
i=j;
j++;
if(i<taul.length-1) pienin = taul[i+1];
} else if(taul[j]<pienin) {
pienin = taul[j];
}
}
System.out.println("Not a proof");
}
public static int asd(int i) {
int x=i+1;
//while(x<taul.length && taul[i] > taul[x]) x++;
return x;
}
public static class IO extends PrintWriter {
private InputStreamReader r;
private static final int BUFSIZE = 1 << 15;
private char[] buf;
private int bufc;
private int bufi;
private StringBuilder sb;
public IO() {
super(new BufferedOutputStream(System.out));
r = new InputStreamReader(System.in);
buf = new char[BUFSIZE];
bufc = 0;
bufi = 0;
sb = new StringBuilder();
}
private void fillBuf() throws IOException {
bufi = 0;
bufc = 0;
while(bufc == 0) {
bufc = r.read(buf, 0, BUFSIZE);
if(bufc == -1) {
bufc = 0;
return;
}
}
}
private boolean pumpBuf() throws IOException {
if(bufi == bufc) {
fillBuf();
}
return bufc != 0;
}
private boolean isDelimiter(char c) {
return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f';
}
private void eatDelimiters() throws IOException {
while(true) {
if(bufi == bufc) {
fillBuf();
if(bufc == 0) throw new RuntimeException("IO: Out of input.");
}
if(!isDelimiter(buf[bufi])) break;
++bufi;
}
}
public String next() {
try {
sb.setLength(0);
eatDelimiters();
int start = bufi;
while(true) {
if(bufi == bufc) {
sb.append(buf, start, bufi - start);
fillBuf();
start = 0;
if(bufc == 0) break;
}
if(isDelimiter(buf[bufi])) break;
++bufi;
}
sb.append(buf, start, bufi - start);
return sb.toString();
} catch(IOException e) {
throw new RuntimeException("IO.next: Caught IOException.");
}
}
public int nextInt() {
try {
int ret = 0;
eatDelimiters();
boolean positive = true;
if(buf[bufi] == '-') {
++bufi;
if(!pumpBuf()) throw new RuntimeException("IO.nextInt: Invalid int.");
positive = false;
}
boolean first = true;
while(true) {
if(!pumpBuf()) break;
if(isDelimiter(buf[bufi])) {
if(first) throw new RuntimeException("IO.nextInt: Invalid int.");
break;
}
first = false;
if(buf[bufi] >= '0' && buf[bufi] <= '9') {
if(ret < -214748364) throw new RuntimeException("IO.nextInt: Invalid int.");
ret *= 10;
ret -= (int)(buf[bufi] - '0');
if(ret > 0) throw new RuntimeException("IO.nextInt: Invalid int.");
} else {
throw new RuntimeException("IO.nextInt: Invalid int.");
}
++bufi;
}
if(positive) {
if(ret == -2147483648) throw new RuntimeException("IO.nextInt: Invalid int.");
ret = -ret;
}
return ret;
} catch(IOException e) {
throw new RuntimeException("IO.nextInt: Caught IOException.");
}
}
public long nextLong() {
try {
long ret = 0;
eatDelimiters();
boolean positive = true;
if(buf[bufi] == '-') {
++bufi;
if(!pumpBuf()) throw new RuntimeException("IO.nextLong: Invalid long.");
positive = false;
}
boolean first = true;
while(true) {
if(!pumpBuf()) break;
if(isDelimiter(buf[bufi])) {
if(first) throw new RuntimeException("IO.nextLong: Invalid long.");
break;
}
first = false;
if(buf[bufi] >= '0' && buf[bufi] <= '9') {
if(ret < -922337203685477580L) throw new RuntimeException("IO.nextLong: Invalid long.");
ret *= 10;
ret -= (long)(buf[bufi] - '0');
if(ret > 0) throw new RuntimeException("IO.nextLong: Invalid long.");
} else {
throw new RuntimeException("IO.nextLong: Invalid long.");
}
++bufi;
}
if(positive) {
if(ret == -9223372036854775808L) throw new RuntimeException("IO.nextLong: Invalid long.");
ret = -ret;
}
return ret;
} catch(IOException e) {
throw new RuntimeException("IO.nextLong: Caught IOException.");
}
}
public double nextDouble() {
return Double.parseDouble(next());
}
}
}
Test details
Test 1
Verdict: ACCEPTED
| input |
|---|
| 89384 25390 71865 40225 42587 ... |
| correct output |
|---|
| Cheater |
| user output |
|---|
| Cheater |
Test 2
Verdict: ACCEPTED
| input |
|---|
| 43243 1 2 3 4 ... |
| correct output |
|---|
| Not a proof |
| user output |
|---|
| Not a proof |
Test 3
Verdict: ACCEPTED
| input |
|---|
| 86810 44076 56049 66715 68415 ... |
| correct output |
|---|
| Cheater |
| user output |
|---|
| Cheater |
Test 4
Verdict: ACCEPTED
| input |
|---|
| 55591 1 14 38 48 ... |
| correct output |
|---|
| Not a proof |
| user output |
|---|
| Not a proof |
Test 5
Verdict: ACCEPTED
| input |
|---|
| 86222 62931 47306 80483 18748 ... |
| correct output |
|---|
| Cheater |
| user output |
|---|
| Cheater |
Test 6
Verdict: ACCEPTED
| input |
|---|
| 15864 1 2 3 5 ... |
| correct output |
|---|
| Not a proof |
| user output |
|---|
| Not a proof |
Test 7
Verdict: ACCEPTED
| input |
|---|
| 16149 2532 961 11156 5824 ... |
| correct output |
|---|
| Cheater |
| user output |
|---|
| Cheater |
Test 8
Verdict: ACCEPTED
| input |
|---|
| 40507 1 2 3 4 ... |
| correct output |
|---|
| Not a proof |
| user output |
|---|
| Not a proof |
Test 9
Verdict: ACCEPTED
| input |
|---|
| 36375 15643 9301 19803 7096 ... |
| correct output |
|---|
| Cheater |
| user output |
|---|
| Cheater |
Test 10
Verdict: ACCEPTED
| input |
|---|
| 77660 3 15 23 25 ... |
| correct output |
|---|
| Not a proof |
| user output |
|---|
| Not a proof |
Test 11
Verdict: ACCEPTED
| input |
|---|
| 56236 18697 40699 9296 14216 ... |
| correct output |
|---|
| Cheater |
| user output |
|---|
| Cheater |
Test 12
Verdict: ACCEPTED
| input |
|---|
| 301 3 2 4 6 ... |
| correct output |
|---|
| Not a proof |
| user output |
|---|
| Not a proof |
Test 13
Verdict: ACCEPTED
| input |
|---|
| 41231 26984 13528 2868 39701 ... |
| correct output |
|---|
| Cheater |
| user output |
|---|
| Cheater |
Test 14
Verdict: ACCEPTED
| input |
|---|
| 72284 1 2 3 4 ... |
| correct output |
|---|
| Not a proof |
| user output |
|---|
| Not a proof |
Test 15
Verdict: ACCEPTED
| input |
|---|
| 18969 3539 8598 12445 18178 ... |
| correct output |
|---|
| Cheater |
| user output |
|---|
| Cheater |
Test 16
Verdict: ACCEPTED
| input |
|---|
| 54454 6 12 14 40 ... |
| correct output |
|---|
| Not a proof |
| user output |
|---|
| Not a proof |
Test 17
Verdict: ACCEPTED
| input |
|---|
| 86784 84064 26105 59782 14615 ... |
| correct output |
|---|
| Cheater |
| user output |
|---|
| Cheater |
Test 18
Verdict: ACCEPTED
| input |
|---|
| 54031 1 4 7 6 ... |
| correct output |
|---|
| Not a proof |
| user output |
|---|
| Not a proof |
Test 19
Verdict: ACCEPTED
| input |
|---|
| 1161 825 98 511 987 ... |
| correct output |
|---|
| Cheater |
| user output |
|---|
| Cheater |
Test 20
Verdict: ACCEPTED
| input |
|---|
| 44073 1 2 3 4 ... |
| correct output |
|---|
| Not a proof |
| user output |
|---|
| Not a proof |
Test 21
Verdict: ACCEPTED
| input |
|---|
| 83617 33109 61789 74135 12472 ... |
| correct output |
|---|
| Cheater |
| user output |
|---|
| Cheater |
Test 22
Verdict: ACCEPTED
| input |
|---|
| 84621 16 26 25 27 ... |
| correct output |
|---|
| Not a proof |
| user output |
|---|
| Not a proof |
Test 23
Verdict: ACCEPTED
| input |
|---|
| 22135 2433 19568 20163 15126 ... |
| correct output |
|---|
| Cheater |
| user output |
|---|
| Cheater |
Test 24
Verdict: ACCEPTED
| input |
|---|
| 79341 1 4 6 5 ... |
| correct output |
|---|
| Not a proof |
| user output |
|---|
| Not a proof |
Test 25
Verdict: ACCEPTED
| input |
|---|
| 17175 13977 4200 33 13602 ... |
| correct output |
|---|
| Cheater |
| user output |
|---|
| Cheater |
Test 26
Verdict: ACCEPTED
| input |
|---|
| 64285 1 2 3 4 ... |
| correct output |
|---|
| Not a proof |
| user output |
|---|
| Not a proof |
Test 27
Verdict: ACCEPTED
| input |
|---|
| 68694 36114 50054 48015 41971 ... |
| correct output |
|---|
| Cheater |
| user output |
|---|
| Cheater |
Test 28
Verdict: ACCEPTED
| input |
|---|
| 3056 14 15 24 57 ... |
| correct output |
|---|
| Not a proof |
| user output |
|---|
| Not a proof |
Test 29
Verdict: ACCEPTED
| input |
|---|
| 96187 84426 32403 60210 35133 ... |
| correct output |
|---|
| Cheater |
| user output |
|---|
| Cheater |
Test 30
Verdict: ACCEPTED
| input |
|---|
| 41500 1 2 3 6 ... |
| correct output |
|---|
| Not a proof |
| user output |
|---|
| Not a proof |
