Submission #3664754


Source Code Expand

import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String s = scan.nextLine();
        char[] c = new char[s.length()];
        int n = s.length();
        for(int i = 0; i < s.length(); i++) {
            c[i] = s.charAt(i);
        }
        char top = c[0];
        char nowTop = c[0];
        int ans = 0;
        for(int i = 0; i < n; i++) {
            if (c[i] <= nowTop) {
                ans++;
                nowTop = c[i];
            }
        }
        System.out.println(ans);
    }
}

Submission Info

Submission Time
Task D - Concatenation
User sarashin
Language Java8 (OpenJDK 1.8.0)
Score 300
Code Size 609 Byte
Status AC
Exec Time 161 ms
Memory 29628 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 30
Set Name Test Cases
Sample s1.txt, s2.txt, s3.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
01.txt AC 90 ms 21844 KB
02.txt AC 90 ms 20820 KB
03.txt AC 160 ms 25028 KB
04.txt AC 161 ms 25928 KB
05.txt AC 92 ms 21972 KB
06.txt AC 89 ms 18644 KB
07.txt AC 91 ms 18900 KB
08.txt AC 91 ms 22608 KB
09.txt AC 90 ms 21076 KB
10.txt AC 91 ms 20692 KB
11.txt AC 157 ms 24260 KB
12.txt AC 146 ms 25412 KB
13.txt AC 147 ms 25676 KB
14.txt AC 144 ms 24140 KB
15.txt AC 155 ms 25004 KB
16.txt AC 157 ms 29628 KB
17.txt AC 153 ms 26308 KB
18.txt AC 158 ms 26916 KB
19.txt AC 156 ms 25156 KB
20.txt AC 161 ms 27332 KB
21.txt AC 158 ms 26316 KB
22.txt AC 158 ms 23092 KB
23.txt AC 158 ms 24776 KB
24.txt AC 154 ms 25032 KB
25.txt AC 155 ms 26172 KB
26.txt AC 152 ms 25932 KB
27.txt AC 160 ms 23100 KB
s1.txt AC 91 ms 20948 KB
s2.txt AC 89 ms 20948 KB
s3.txt AC 90 ms 20692 KB