Official

A - New Scheme Editorial by en_translator


If you are new to learning programming and do not know where to start, please try Problem A “Welcome to AtCoder” from practice contest. There you can find a sample code for each language.
Also, if you are not familiar with problems in programming contests, we recommend you to try some problems in “AtCoder Beginners Selection” (https://atcoder.jp/contests/abs).


Use for statements and if statements to determine if the conditions in the problem statement are satisfied. For details on implementation, see the sample codes below.

Sample code (C++):

#include<bits/stdc++.h>

using namespace std;

int main() {
    vector<int> s(8);
    for (int &i: s) cin >> i;
    for (int i = 0; i < 8; i++) {
        if (i < 7 and s[i] > s[i + 1]) {
            cout << "No" << endl;
            return 0;
        }
        if (s[i] < 100 or s[i] > 675 or s[i] % 25 != 0) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}

Sample code (Python) :

import sys

s = list(map(int, input().split()))
for i in range(8):
    if i < 7 and s[i] > s[i + 1]:
        print("No")
        sys.exit()
    if s[i] < 100 or s[i] > 675 or s[i] % 25 != 0:
        print("No")
        sys.exit()
print("Yes")

posted:
last update: