Submission #25549748


Source Code Expand

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

int main(){
    long n;
    cin >> n;
    string s;
    while(n){
        if(n&1){
            s += "A";
            n--;
        }else{
            s += "B";
            n/=2;
        }
    }
    reverse(s.begin(), s.end());
    cout << s;
    cout << '\n';
}

Submission Info

Submission Time
Task C - Many Balls
User medhruv7
Language C++ (GCC 9.2.1)
Score 300
Code Size 328 Byte
Status AC
Exec Time 7 ms
Memory 3592 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 20
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 7 ms 3448 KiB
001.txt AC 2 ms 3504 KiB
002.txt AC 2 ms 3592 KiB
003.txt AC 2 ms 3580 KiB
004.txt AC 2 ms 3588 KiB
005.txt AC 2 ms 3492 KiB
006.txt AC 3 ms 3416 KiB
007.txt AC 2 ms 3516 KiB
008.txt AC 3 ms 3560 KiB
009.txt AC 2 ms 3452 KiB
010.txt AC 2 ms 3440 KiB
011.txt AC 2 ms 3420 KiB
012.txt AC 2 ms 3444 KiB
013.txt AC 2 ms 3440 KiB
014.txt AC 3 ms 3444 KiB
015.txt AC 4 ms 3452 KiB
016.txt AC 5 ms 3592 KiB
017.txt AC 2 ms 3504 KiB
example0.txt AC 2 ms 3552 KiB
example1.txt AC 2 ms 3420 KiB