1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

0.はじめに

 アレルギーっぽい体調が悪さが続く今日この頃。
 その割に回答の調子は良くABCDは順調にとけました。
 Eはさすがに難しく考えているうちに眠くなり終了。
 それでもレートは+43と躍進し814に。
 2か月ぶりの緑復帰となりました。
 ちなみにEは翌日解説を見ましたが自力で
 解ける気はしない感じでした。

1. A - Chompers

 文字列の問題。
 SとNを入力し、Sの前と後ろからN文字ずつ
 省いて出力して終了。

 https://atcoder.jp/contests/abc458/submissions/75836777

2.B - Count Adjacent Cells

 なかなかややこしい問題。
 余り複雑にするのも何なので
 iとjをHとWまで繰り返し
 2次元ループの中で上下左右の端でないかを
 1マスずつチェックしマス毎の隣接マスを
 数え表に集計し1行ずつ出力して終了。

 https://atcoder.jp/contests/abc458/submissions/75850197

3.C - C Stands for Center

 問題文の条件から、S内のC毎に、その前と後の文字数で少ない数+1
 の部分文字列が作れる事が分かる。
  例)10文字の文字列で3文字目と5文字目と7文字目がCの時
   3文字目・・・前2文字、後ろ7文字 ・・3種類の部分文字列が作成可能
   5文字目・・・前4文字、後ろ5文字 ・・4種類の部分文字列が作成可能
   7文字目・・・前6文字、後ろ3文字 ・・3種類の部分文字列が作成可能
    →計10種類の部分文字列が作成可能。

 後は文字列を前から見ていき、値がCの時作成できる文字列を数え
 集計して出力して終了。 

 https://atcoder.jp/contests/abc458/submissions/75858993

4.D - Chalkboard Median

 pythonのソーテッドコンテナを使えばあまり考えずに
 ACとなりました。

 【実装】
  1.X、Qを読み込む
  2.ソーテッドリストLを作成しXに入れる
  3.以下Q回繰り返し(iを0~Q-1でカウントアップ)
   -1.AとBを読み込む
   -2.AとBをLに追加
   -3.リストのi+1番目を出力

 https://atcoder.jp/contests/abc458/submissions/75864173

以上

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?