結果
問題 | No.2775 Nuisance Balls |
ユーザー |
|
提出日時 | 2024-06-07 22:00:46 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 621 bytes |
コンパイル時間 | 2,626 ms |
コンパイル使用メモリ | 203,620 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 08:01:52 |
合計ジャッジ時間 | 3,535 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#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;}