본문 바로가기

div213

Codeforces Round #666 (Div. 2) AC #include using namespace std; int TEST; int n; string s; map chars; int cnt[26]; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> TEST; while (TEST--) { cin >> n; for (int i = 0; i > s; for (char c : s) { cnt[int(c - 'a')] += 1; } } bool isGood = true; for (int i = 0; i < 26; ++i) { if (cnt[i] % n != 0) isGood = false; cnt[i] = 0; } cout n; for (int i = 1; i.. 2020. 8. 31.
Educational Codeforces Round 93 (Rated for Div. 2) AB from sys import stdin def input(): return stdin.readline().rstrip() for _ in range(int(input())): L=int(input()) s=list(map(int,input().split())) if s[0]+s[1]>s[-1]: print(-1) else: print(1,2,L) A - Bad Triangle 입력이 오름차순이므로 1, 2번과 마지막번만 비교하면 된다. from sys import stdin def input(): return stdin.readline().rstrip() for _ in range(int(input())): s=input().split("0") for i in range(len(s)): s[i]=len(.. 2020. 8. 15.
Codeforces Round #663 (Div. 2) ABC from sys import stdin def input(): return stdin.readline().rstrip() for i in range(int(input())): n=int(input()) for _ in range(1,n+1): print(_,end=" ") print() A - Suborrays 0분에 제출한 사람이 너무 많아서 단순히 n까지 출력하는 도박을 했고 AC를 받았다. from sys import stdin def input(): return stdin.readline().rstrip() T=int(input()) for i in range(T): res=0 r,c=map(int,input().split()) for j in range(r): line=input() if j==.. 2020. 8. 10.
Codeforces Round #662 (Div. 2) ABC from sys import stdin def input(): return stdin.readline().rstrip() for _ in range(int(input())): n=int(input()) print(1+n//2) A - Rainbow Dash, Fluttershy and Chess Coloring 직접 시뮬레이션 해 보면 1 - 2 - 2 - 3 - 3 - 4 - 4 - ... 순으로 답이 됨을 알 수 있다. #include #include #include #include #include using namespace std; int n, q; map plank; char oper; int target; int main() { ios::sync_with_stdio(0); cin.tie(0);.. 2020. 8. 8.
Codeforces Round #660 (Div. 2) AB from sys import stdin T=int(stdin.readline()) for _ in range(T): n=int(stdin.readline()) if n 2020. 8. 6.
Educational Codeforces Round 92 (Rated for Div. 2) A from sys import stdin from math import gcd def lcm(a, b): return a * b / gcd(a, b) T=int(stdin.readline()) for _ in range(T): l,r=map(int,stdin.readline().split()) if l==1: print(1,2) else: if lcm(l,int(l*(1.5))) 2020. 8. 6.