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?

More than 5 years have passed since last update.

AtCoder 生活 92日目

Posted at

前回

92日目

今回はM-SOLUTIONS プロコンオープン 2020に参加しました。

スクリーンショット 2020-07-25 22.41.45.png

M-SOLUTIONS プロコンオープン 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(){
    int x;
    cin >> x;
    if(x < 600)cout << 8 << endl;
    else if(x < 800) cout << 7 << endl;
    else if(x < 1000)cout << 6 << endl;
    else if(x < 1200)cout << 5 << endl;
    else if(x < 1400)cout << 4 << endl;
    else if(x < 1600)cout << 3 << endl;
    else if(x < 1800)cout << 2 << endl;
    else cout << 1 << 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 a,b,c,k;
    cin >> a >> b >> c >> k;
    int cnt = 0;
    while(a >= b){
        b *= 2;
        cnt++;
    }
    while(b >= c){
        c *= 2;
        cnt++;
    }
    if(cnt <= k)cout << "Yes" << endl;
    else cout << "No" << 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,k;
    cin >> n >> k;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    rep(i,n-k){
        if(a[i] < a[i+k])cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}

D


# 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<ll> a(n);
    rep(i,n) cin >> a[i];
    ll mon = 1000LL;
    ll k = 0LL;
    rep(i,n-1){
        if(a[i] < a[i+1]){
            k += mon/a[i];
            mon %= a[i];
        }
        else{
            mon += k*a[i];
            k = 0;
        }
    }
    mon += k*a[n-1];
    cout << mon << endl;
}

最後に

初めてこんなに上の順位に来れたことが嬉しい!
D問題までを40分で解けたことで自分がレベルアップできている気がする。
次のコンテストもこれぐらいいい成績を残したい。

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?