Submission #25411996
Source Code Expand
#include <iostream>
#include <algorithm>
using namespace std;
unsigned long long N;
int main() {
cin >> N;
string X;
while (N > 0) {
if (N % 2) {
X += 'A';
N--;
}
if (N == 0) { break; }
X += 'B';
N = (N >> 1);
}
reverse(X.begin(), X.end());
cout << X << endl;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Many Balls |
| User | daimatz |
| Language | C++ (GCC 9.2.1) |
| Score | 300 |
| Code Size | 331 Byte |
| Status | AC |
| Exec Time | 5 ms |
| Memory | 3628 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example0.txt, example1.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, example0.txt, example1.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 000.txt | AC | 5 ms | 3584 KiB |
| 001.txt | AC | 2 ms | 3572 KiB |
| 002.txt | AC | 2 ms | 3492 KiB |
| 003.txt | AC | 2 ms | 3592 KiB |
| 004.txt | AC | 2 ms | 3596 KiB |
| 005.txt | AC | 2 ms | 3572 KiB |
| 006.txt | AC | 3 ms | 3500 KiB |
| 007.txt | AC | 2 ms | 3576 KiB |
| 008.txt | AC | 2 ms | 3548 KiB |
| 009.txt | AC | 2 ms | 3496 KiB |
| 010.txt | AC | 2 ms | 3556 KiB |
| 011.txt | AC | 2 ms | 3552 KiB |
| 012.txt | AC | 2 ms | 3484 KiB |
| 013.txt | AC | 3 ms | 3592 KiB |
| 014.txt | AC | 3 ms | 3588 KiB |
| 015.txt | AC | 3 ms | 3628 KiB |
| 016.txt | AC | 3 ms | 3532 KiB |
| 017.txt | AC | 3 ms | 3628 KiB |
| example0.txt | AC | 3 ms | 3436 KiB |
| example1.txt | AC | 2 ms | 3436 KiB |