結果
問題 |
No.3299 K-th MMA String
|
ユーザー |
![]() |
提出日時 | 2025-10-05 15:30:20 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 354 bytes |
コンパイル時間 | 2,880 ms |
コンパイル使用メモリ | 276,080 KB |
実行使用メモリ | 11,044 KB |
最終ジャッジ日時 | 2025-10-05 15:30:42 |
合計ジャッジ時間 | 8,041 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | AC * 10 WA * 1 TLE * 1 -- * 8 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < (int)(n); i++) int main(){ int N, K, ans = 0, f; cin >> N >> K; while(K){ ans++; f = 0; rep(i, N-2){ if((ans>>i)%2 == 0 && (ans>>i+1)%2 && (ans>>i+2)%2)f = 1; } K -= f; } rep(i, N)cout << ((ans>>N-i-1)%2 ? 'M' : 'A'); cout << endl; }