CSES - Datatähti 2023 alku - Results
Submission details
Task:Kortit
Sender:stpn129
Submission time:2022-10-31 08:44:31 +0200
Language:C++ (C++11)
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.00 sdetails
#2ACCEPTED0.00 sdetails
#3ACCEPTED0.00 sdetails
#4ACCEPTED0.00 sdetails
#5ACCEPTED0.00 sdetails
#6ACCEPTED0.00 sdetails

Code

#include "bits/stdc++.h"
using namespace std;

void init_code() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
}

void solve() {
  int n;
  cin >> n;
  if (n <= 1) {
    cout << "NO";
  } else if (n < 27) {
    cout << "MAYBE";
  } else {
    cout << "YES";
  }
}

signed main() {
  init_code();
  int t = 1;
  //cin >> t;
  while (t--) {
    solve();  
  }
  return 0;
}

/*


vector<pair<int, int>> moves = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
  int n, m;
  cin >> n >> m;

  char x;
  pair<int,int> sa, sb;

  vector<vector<int>> a(n, vector<int> (m));
  for (int i = 0; i < n; ++i){
     for (int j = 0; j < m; ++j) {
       cin >> x;
       if (x == '#') { 
        a[i][j] = 0;
       } else if (x == '.'){
        a[i][j] = 1;
       } else if (x == 'A'){
        a[i][j] = 2;
        sa = {i, j};
       } else if (x == 'B'){
        a[i][j] = 3;
        sb = {i, j};
       }
     }
  }
  vector<vector<int>> used(n, vector<int> (m));
  used[sa.first][sa.second] = 1; used[sb.first][sb.second] = 2;
  
  set<pair<int, int>> q;
  q.insert(sa);

  pair<int, int> v;
  
  vector<pair<int, int>> 
  while (!q.empty()) {
    v = *q.begin();
    q.erase(q.begin());
    for (auto mv : moves) {
        int x = v.first + mv.first, y = v.second + mv.second;
        if (x >= 0 && x < n && y >= 0 && y < m && a[x][y] == 1 && used[x][y] == 0) {
          used[x][y] = 1;
          q.insert({x, y});
        }
    }
  }

  q.insert(sb);
  while (!q.empty()) {
    v = *q.begin();
    q.erase(q.begin());
    for (auto mv : moves) {
        int x = v.first + mv.first, y = v.second + mv.second;
        if (x >= 0 && x < n && y >= 0 && y < m && a[x][y] == 1 && used[x][y] == 0) {
          used[x][y] = 2;
          q.insert({x, y});
        } else if (x >= 0 && x < n && y >= 0 && y < m && a[x][y] == 1 && used[x][y] == 1) {
          cout << 1 << '\n';
          return;
        }
    }
  }

  for (int i = 0; i < ; ++i) {
    
  }
*/

Test details

Test 1

Verdict: ACCEPTED

input
0

correct output
NO

user output
NO

Test 2

Verdict: ACCEPTED

input
1

correct output
NO

user output
NO

Test 3

Verdict: ACCEPTED

input
2

correct output
MAYBE

user output
MAYBE

Test 4

Verdict: ACCEPTED

input
26

correct output
MAYBE

user output
MAYBE

Test 5

Verdict: ACCEPTED

input
27

correct output
YES

user output
YES

Test 6

Verdict: ACCEPTED

input
52

correct output
YES

user output
YES