Submission #744796
Source Code Expand
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.ArrayList;
class Main{
public Main(){}
public void run(){
try{
Scanner s = new Scanner();
int n = s.nextInt();
s.reset();
int[] a = new int[n];
for(int i = 0;i<a.length;i++){
a[i] = s.nextInt();
}
int count = 0;
for(int i = 0;i<a.length;i++){
int l = i;
for(int j = i;j<a.length;j++){
int r = j;
boolean flag = true;
for(int p = l;p<r;p++){
if(!(a[p] < a[p+1])){
flag = false;
}
}
if(flag){
// System.out.println("l,r="+l+","+r);
count++;
}
}
}
System.out.println(count);
}catch(Exception e){
e.printStackTrace();
}
}
public static void main(String[] argv){
Main main = new Main();
main.run();
}
private class Scanner{
private int p;
private BufferedReader br;
String regex = " ";
String[] token;
public Scanner(){
br = new BufferedReader(new InputStreamReader(System.in));
p = -1;
token = new String[0];
}
void setRegex(String str){
this.regex = str;
}
void reset(){
p = -1;
token = new String[0];
}
String next() throws IOException{
if(p < 0){
String line = br.readLine();
while("".equals(line))line = br.readLine();
token = line.split(regex,0);
p = 0;
return token[p++];
}else{
if(p<token.length)return token[p++];
p = -1;
return null;
}
}
int nextInt() throws NumberFormatException, IOException{
return Integer.parseInt(next());
}
long nextLong() throws NumberFormatException, IOException{
return Long.parseLong(next());
}
double nextDouble() throws NumberFormatException, IOException{
return Double.parseDouble(next());
}
String nextString() throws NumberFormatException, IOException{
return next();
}
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - 単調増加 |
| User | shopon1201 |
| Language | Java8 (OpenJDK 1.8.0) |
| Score | 0 |
| Code Size | 2036 Byte |
| Status | TLE |
| Exec Time | 2109 ms |
| Memory | 23252 KiB |
Judge Result
| Set Name | Sample | Subtask0 | All | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 40 | 0 / 60 | ||||||||||
| Status |
|
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample0.txt, sample1.txt, sample2.txt, sample3.txt |
| Subtask0 | sample0.txt, sample1.txt, sample2.txt, sample3.txt, subtask0_0.txt, subtask0_1.txt, subtask0_10.txt, subtask0_11.txt, subtask0_12.txt, subtask0_13.txt, subtask0_14.txt, subtask0_2.txt, subtask0_3.txt, subtask0_4.txt, subtask0_5.txt, subtask0_6.txt, subtask0_7.txt, subtask0_8.txt, subtask0_9.txt |
| All | subtask0_0.txt, subtask0_1.txt, subtask0_10.txt, subtask0_11.txt, subtask0_12.txt, subtask0_13.txt, subtask0_14.txt, subtask0_2.txt, subtask0_3.txt, subtask0_4.txt, subtask0_5.txt, subtask0_6.txt, subtask0_7.txt, subtask0_8.txt, subtask0_9.txt, subtask1_0.txt, subtask1_1.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_2.txt, subtask1_3.txt, subtask1_4.txt, subtask1_5.txt, subtask1_6.txt, subtask1_7.txt, subtask1_8.txt, subtask1_9.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| sample0.txt | AC | 159 ms | 7892 KiB |
| sample1.txt | AC | 152 ms | 8020 KiB |
| sample2.txt | AC | 156 ms | 8020 KiB |
| sample3.txt | AC | 165 ms | 7892 KiB |
| subtask0_0.txt | TLE | 2107 ms | 8660 KiB |
| subtask0_1.txt | TLE | 2107 ms | 8532 KiB |
| subtask0_10.txt | TLE | 2107 ms | 8916 KiB |
| subtask0_11.txt | TLE | 2107 ms | 8908 KiB |
| subtask0_12.txt | TLE | 2107 ms | 8660 KiB |
| subtask0_13.txt | TLE | 2107 ms | 8660 KiB |
| subtask0_14.txt | TLE | 2103 ms | 8660 KiB |
| subtask0_2.txt | AC | 715 ms | 8660 KiB |
| subtask0_3.txt | AC | 1014 ms | 8528 KiB |
| subtask0_4.txt | TLE | 2107 ms | 8532 KiB |
| subtask0_5.txt | AC | 165 ms | 8276 KiB |
| subtask0_6.txt | AC | 198 ms | 8660 KiB |
| subtask0_7.txt | AC | 1973 ms | 8656 KiB |
| subtask0_8.txt | AC | 187 ms | 8660 KiB |
| subtask0_9.txt | TLE | 2107 ms | 8532 KiB |
| subtask1_0.txt | TLE | 2109 ms | 22484 KiB |
| subtask1_1.txt | TLE | 2108 ms | 14452 KiB |
| subtask1_10.txt | TLE | 2108 ms | 20436 KiB |
| subtask1_11.txt | TLE | 2108 ms | 20312 KiB |
| subtask1_12.txt | TLE | 2108 ms | 21844 KiB |
| subtask1_13.txt | TLE | 2108 ms | 20304 KiB |
| subtask1_14.txt | TLE | 2108 ms | 20932 KiB |
| subtask1_15.txt | TLE | 2108 ms | 20316 KiB |
| subtask1_2.txt | TLE | 2108 ms | 13524 KiB |
| subtask1_3.txt | TLE | 2109 ms | 23252 KiB |
| subtask1_4.txt | TLE | 2109 ms | 22484 KiB |
| subtask1_5.txt | TLE | 2109 ms | 22420 KiB |
| subtask1_6.txt | TLE | 2108 ms | 14804 KiB |
| subtask1_7.txt | TLE | 2108 ms | 20860 KiB |
| subtask1_8.txt | TLE | 2108 ms | 13268 KiB |
| subtask1_9.txt | TLE | 2108 ms | 11728 KiB |