CODE THANKS FESTIVAL 2018(Parallel)

Submission #10067939

Source codeソースコード

# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [input() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [int(input()) for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def roundUp(a, b):
        return -(-a // b)

    @staticmethod
    def toUpperMultiple(a, x):
        return Math.roundUp(a, x) * x

    @staticmethod
    def toLowerMultiple(a, x):
        return (a // x) * x

    @staticmethod
    def nearPow2(n):
        if n <= 0:
            return 0
        if n & (n - 1) == 0:
            return n
        ret = 1
        while(n > 0):
            ret <<= 1
            n >>= 1
        return ret

    @staticmethod
    def sign(n):
        if n == 0:
            return 0
        if n < 0:
            return -1
        return 1

    @staticmethod
    def isPrime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


class PriorityQueue:
    def __init__(self, l=[]):
        self.__q = l
        heapq.heapify(self.__q)
        return

    def push(self, n):
        heapq.heappush(self.__q, n)
        return

    def pop(self):
        return heapq.heappop(self.__q)


sys.setrecursionlimit(1000000)
MOD = int(1e09) + 7
INF = int(1e15)


def main():
    # sys.stdin = open("Sample.txt")
    S = Scanner.string()
    N = len(S)
    c = chr(ord(S[0]) + 1)
    ans = 0
    for i in range(N):
        if S[i] <= c:
            ans += 1
            c = S[i]
    print(ans)
    return


if __name__ == "__main__":
    main()

Submission

Task問題 D - Concatenation
User nameユーザ名 matsu0112
Created time投稿日時
Language言語 PyPy3 (2.4.0)
Status状態 AC
Score得点 300
Source lengthソースコード長 2675 Byte
File nameファイル名
Exec time実行時間 188 ms
Memory usageメモリ使用量 40300 KB

Test case

Set

Set name Score得点 / Max score Cases
Sample - s1.txt,s2.txt,s3.txt
All 300 / 300 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

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
01.txt AC 178 ms 38636 KB
02.txt AC 175 ms 38512 KB
03.txt AC 181 ms 40172 KB
04.txt AC 182 ms 40172 KB
05.txt AC 177 ms 38636 KB
06.txt AC 176 ms 38512 KB
07.txt AC 175 ms 38512 KB
08.txt AC 178 ms 38512 KB
09.txt AC 175 ms 38512 KB
10.txt AC 177 ms 38512 KB
11.txt AC 182 ms 40172 KB
12.txt AC 181 ms 40044 KB
13.txt AC 182 ms 40172 KB
14.txt AC 182 ms 40300 KB
15.txt AC 185 ms 40180 KB
16.txt AC 182 ms 40172 KB
17.txt AC 184 ms 40300 KB
18.txt AC 184 ms 40172 KB
19.txt AC 183 ms 40300 KB
20.txt AC 182 ms 40172 KB
21.txt AC 180 ms 40044 KB
22.txt AC 180 ms 40044 KB
23.txt AC 181 ms 40044 KB
24.txt AC 183 ms 40044 KB
25.txt AC 181 ms 40044 KB
26.txt AC 185 ms 40044 KB
27.txt AC 188 ms 40044 KB
s1.txt AC 176 ms 38512 KB
s2.txt AC 175 ms 38512 KB
s3.txt AC 176 ms 38512 KB