結果

問題 No.2775 Nuisance Balls
ユーザー haihamabossu
提出日時 2024-06-07 22:00:46
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 621 bytes
コンパイル時間 1,928 ms
コンパイル使用メモリ 196,192 KB
最終ジャッジ日時 2025-02-21 20:18:04
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

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

void solve() {
  ll n;
  cin >> n;
  vector<pair<char, ll>> a = {
      {'.', 1}, {'o', 6}, {'R', 30}, {'S', 180}, {'M', 360}, {'C', 720},
  };
  auto [c, now] = a.back();
  a.pop_back();
  while (n) {
    if (n < now) {
      tie(c, now) = a.back();
      a.pop_back();
      continue;
    }
    cout << c;
    n -= now;
  }
  cout << '\n';
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  int T = 1;
  for (int t = 0; t < T; t++) {
    solve();
  }
  return 0;
}
0