View accum_string.cpp
#include <iostream> | |
#include <vector> | |
#include <numeric> | |
#include <string> | |
using namespace std; | |
int main(){ | |
vector<string> A = {"I", "have", "a", "pen."}; |
View accum_pair.cpp
#include <iostream> | |
#include <vector> | |
#include <numeric> | |
using namespace std; | |
int main(){ | |
vector<int> A = {1, 2, 3, 3, 2}; | |
int sum = accumulate(A.begin(), A.end(), 0, [](int init, int v){ return init + v; }); | |
cout << sum << "\n"; |
View ABC187_D.py
import sys | |
def input(): return sys.stdin.readline().rstrip() | |
from bisect import bisect_left,bisect | |
from itertools import accumulate | |
def main(): | |
n = int(input()) | |
AB = [tuple(map(int,input().split())) for i in range(n)] | |
C = [0]*n | |
sum_a = 0 | |
for i, (a, b) in enumerate(AB): |
View ABC187_C.py
import sys | |
def input(): return sys.stdin.readline().rstrip() | |
def main(): | |
n = int(input()) | |
S = [input() for i in range(n)] | |
S.sort() | |
for i, s in enumerate(S): | |
if s[0] != '!': | |
idx_s2 = i | |
break |
View ABC187_B.py
import sys | |
def input(): return sys.stdin.readline().rstrip() | |
def main(): | |
n = int(input()) | |
XY = [[int(_) for _ in input().split()] for i in range(n)] | |
ans = 0 | |
for i in range(n): | |
x_i = XY[i][0] | |
y_i = XY[i][1] | |
for j in range(i + 1, n): |
View ABC187_A.py
import sys | |
def input(): return sys.stdin.readline().rstrip() | |
def main(): | |
a, b = input().split() | |
s_a = int(a[0]) + int(a[1]) + int(a[2]) | |
s_b = int(b[0]) + int(b[1]) + int(b[2]) | |
print(max(s_a, s_b)) | |
if __name__=='__main__': | |
main() |
View ALCBC_D.gyp
import sys | |
def input(): return sys.stdin.readline().rstrip() | |
from fractions import gcd | |
class seg(): | |
def __init__(self,init_val): | |
self.n=len(init_val) | |
self.ide_ele= 0 #単位元 | |
self.num=2**(self.n-1).bit_length() #n以上の最小の2のべき乗 | |
self.seg=[self.ide_ele]*2*self.num | |
for i in range(self.n): |
View ALCBC_C.gyp
import sys | |
def input(): return sys.stdin.readline().rstrip() | |
class UnionFind(): | |
def __init__(self, n): | |
self.n=n | |
self.parents=[-1]*n # 親(uf.find()で経路圧縮して根)の番号。根の場合は-(そのグループの要素数) | |
def find(self,x): | |
#グループの根を返す | |
if self.parents[x]<0:return x | |
else: |
View ALCBC_B.gyp
import sys | |
def input(): return sys.stdin.readline().rstrip() | |
def main(): | |
a, b, c, d = map(int,input().split()) | |
if max(a, c) <= min(b,d): | |
print("Yes") | |
else: | |
print("No") | |
if __name__=='__main__': |
View ALCBC_A.gyp
import sys | |
def input(): return sys.stdin.readline().rstrip() | |
def main(): | |
k = int(input()) | |
ans = "" | |
for i in range(k): | |
ans += "ACL" | |
print(ans) | |
if __name__=='__main__': |
NewerOlder