QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#96209#2920. Ultimate Binary WatchAbdelrahman_K#RE 0ms3332kbC++14887b2023-04-13 17:08:452023-04-13 17:08:49

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-13 17:08:49]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:3332kb
  • [2023-04-13 17:08:45]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define F first
#define S second
const int N = 1e5 + 2;

int main() {
    int n;
    cin>>n;
    vector<int> vec[4];
    int i = 3;
    while(n){
        int x = n % 10;
        n /= 10;
        while(x){
            vec[i].push_back(x % 2);
            x /= 2;
        }
        while(vec[i].size() < 4){
            vec[i].push_back(0);
        }
        reverse(vec[i].begin(), vec[i].end());
        i--;
    }
    for(int j = 0; j < 4; j++){
        for(int k = 0; k < 4; k++){
            if(vec[k][j] == 1)
                cout<<'*';
            else
                cout<<'.';
            if(k == 0 || k == 2)
                cout<<' ';
            else if(k == 1)
                cout<<"   ";
            else
                cout<<endl;
        }
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3332kb

input:

1234

output:

. .   . .
. .   . *
. *   * .
* .   * .

result:

ok 4 lines

Test #2:

score: -100
Runtime Error

input:

0056

output:


result: