結果
問題 | No.908 うしたぷにきあくん文字列 |
ユーザー |
![]() |
提出日時 | 2019-10-27 23:03:28 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,882 bytes |
コンパイル時間 | 191 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,648 KB |
最終ジャッジ日時 | 2024-09-14 21:08:49 |
合計ジャッジ時間 | 1,611 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 2 |
other | RE * 18 |
ソースコード
from collections import deque,defaultdict,Counterfrom itertools import accumulateimport bisectfrom heapq import heappop,heappushfrom fractions import gcdfrom copy import deepcopyimport mathimport queue#import numpy as np#import sympy as syp(素因数分解とか)Mod = 1000000007def sieve_of_eratosthenes(n):if not isinstance(n,int):raise TypeError("n is not int")if n<2:raise ValueError("n is not effective")prime = [1]*(n+1)for i in range(2,int(math.sqrt(n))+1):if prime[i] == 1:for j in range(2*i,n+1):if j%i == 0:prime[j] = 0res = []for i in range(2,n+1):if prime[i] == 1:res.append(i)return resdef factorial(i):if i == 1:return 1else:return i*factorial(i-1)class UnionFind:def __init__(self,n):self.parent = [i for i in range(n+1)]self.rank = [0 for i in range(n+1)]def findroot(self,x):if x == self.parent[x]:return xelse:y = self.parent[x]y = self.findroot(self.parent[x])return ydef union(self,x,y):px = self.findroot(x)py = self.findroot(y)if px < py:self.parent[py] = pxelse:self.parent[px] = pydef same_group_or_no(self,x,y):return self.findroot(x) == self.findroot(y)def main(): #startline-------------------------------------------S = input()n = len(S)flag = Truefor i in range(n):if i % 2 != 0:if S[i] != " ":flag = Falseelse:if not(S[i].islower()):flag = Falseprint("Yes" if flag else "No")if __name__ == "__main__":main() #endline===============================================