0
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?

More than 5 years have passed since last update.

AtCoder 生活 95日目

Posted at

前回

95日目

HHKB プログラミングコンテスト 2020に参加しました。

スクリーンショット 2020-10-10 22.41.32.png

HHKB プログラミングコンテスト 2020

A


# include <bits/stdc++.h>
# define rep(i,n) for(int i = 0;i < (n);i++)
using namespace std;
using ll = long long;
using pii = pair<int,int>;

const int INF = 2e9;

int main(){
    char s,t;
    cin >> s >> t;
    char a = t-32;
    if(s == 'Y')cout << a << endl;
    else cout << t << endl;
}

B


# include <bits/stdc++.h>
# define rep(i,n) for(int i = 0;i < (n);i++)
using namespace std;
using ll = long long;
using pii = pair<int,int>;

const int INF = 2e9;

int main(){
    int h,w;
    cin >> h >> w;
    vector<string> s(h);
    rep(i,h)cin >> s[i];
    ll ans = 0;
    rep(i,h){
        rep(j,w){
            if(s[i][j] == '#')continue;
            else{
                if(i+1 != h){
                    if(s[i+1][j] == '.')ans++;
                }
                if(j+1 == w){
                    if(s[i][j+1] == '.')ans++;
                }
            }
        }
    }
    cout << ans << endl;
}

C


# include <bits/stdc++.h>
# define rep(i,n) for(int i = 0;i < (n);i++)
using namespace std;
using ll = long long;
using pii = pair<int,int>;

const int INF = 2e9;

int main(){
    int n;
  	cin >> n;
    vector<bool> flag(n+1);
    int num = 0;
    rep(i,n){
        int a;
        cin >> a;
        flag[a] = true;
        while(true){
            if(flag[num] == false){
                cout << num << endl;
                break;
            }
          	else num++;
        }
    }
}

最後に

D問題が全然わからなかった。
久しぶりの更新。
最近学校やらバイトやらスクールで時間をうまく取れなくて疎かになってきてしまった。
最近なかなか解けなくなってきてしまったので、もっとうまく時間をとって励んでいきたい!

0
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
0
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?