diff --git a/src/content/blog-metas/2025-12-06-abc435.json b/src/content/blog-metas/2025-12-06-abc435.json new file mode 100644 index 0000000..e4208fd --- /dev/null +++ b/src/content/blog-metas/2025-12-06-abc435.json @@ -0,0 +1,3 @@ +{ + "postDate": "2025-12-06T14:48:28.149Z" +} diff --git a/src/content/blogs/2025-12-06-ABC435.md b/src/content/blogs/2025-12-06-ABC435.md new file mode 100644 index 0000000..dc93421 --- /dev/null +++ b/src/content/blogs/2025-12-06-ABC435.md @@ -0,0 +1,135 @@ +--- +title: ABC435感想 +description: ABC435の感想を書く。 +author: yuuma +category: other +tags: [advent-calendar,kyopuro] +--- +- この記事は [OUCC Advent Calendar 2025](https://adventar.org/calendars/12077) の7日目の記事です。 +- ABC435に参加した感想を書きます。(~~ネタがない~~) +## AtCoderとは +- AtCoderはざっくりいうとプログラミングの問題を解くコンテストを開催しているサイトです。ABCはAtCoder Beginner Contestの略で、初心者向け?のコンテストです。大体毎週土曜日の21:00から開催され、制限時間は100分です。 +- リンク: https://atcoder.jp/ + +## A問題 +- 問題文: https://atcoder.jp/contests/abc435/tasks/abc435_a +- 解法: 1~Nまでの総和を求めるので、等差数列の和の公式を使います。普通に足し算してもいいはず。 +- 提出コード +```python +N=int(input()) +print(N*(N+1)//2) +``` +## B問題 +- 問題文: https://atcoder.jp/contests/abc435/tasks/abc435_b +- 解法:2重ループで区間を全探索する問題です。 +- 提出コード +```python +ans=0 +N=int(input()) +A=list(map(int,input().split())) +for i in range(N): + for j in range(i,N): + tmp=0 + for k in range(i,j+1): + tmp+=A[k] + f=True + for k in range(i,j+1): + if tmp%A[k]==0: + f=False + if f: + ans+=1 +print(ans) +``` +## C問題 +- 問題文: https://atcoder.jp/contests/abc435/tasks/abc435_c +- 解法: 最も右に伸びるドミノだけを考えればいいです。 +- 提出コード +```python +N=int(input()) +A=list(map(int,input().split())) +ans=0 +r=A[0]+1 +for i in range(N): + if i+1