QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#96585#2920. Ultimate Binary WatchAli_Tarek99AC ✓2ms3408kbC++141.3kb2023-04-14 16:29:332023-04-14 16:29:36

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-14 16:29:36]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3408kb
  • [2023-04-14 16:29:33]
  • 提交

answer

#include <bits/stdc++.h>

#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define in(x) for(auto &j : x) cin >> j
#define out(x) for(auto &j : x) cout << j << ' '
#define all(x) x.begin() , x.end()

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using namespace std;

int dx[] = {0, 0, 1, -1, 1, -1, 1, -1}, dy[] = {1, -1, 0, 0, 1, -1, -1, 1};
ll const mod = 1e9 + 7, N = 1e6 + 5;


int main() {
    fast
    //freopen("energy.txt" , "r", stdin);
    //freopen("output.txt" , "w" , stdout);

    int t = 1, W = 1;
    //cin >> t;
    while (t--) {
        string s;
        cin >> s;
        int a[4];
        for (int i = 0; i < s.size(); ++i) {
            a[i] = s[i] - '0';
        }
        vector<char> ans[4];
        for (int i = 0; i < 4; ++i) {
            int checkbit = 1 << 3;
            while(checkbit > 0) {
                if(checkbit & a[i]){
                    ans[i].push_back('*');
                }
                else ans[i].push_back('.');
                checkbit >>= 1;
            }
        }
        for (int i = 0; i < ans[0].size(); ++i) {
            for (int j = 0; j < 4; ++j) {
                cout << ans[j][i] <<' ';
                if(j == 1) cout << "  ";
            }
            cout <<'\n';
        }
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3320kb

input:

1234

output:

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

result:

ok 4 lines

Test #2:

score: 0
Accepted
time: 2ms
memory: 3404kb

input:

0056

output:

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

result:

ok 4 lines

Test #3:

score: 0
Accepted
time: 2ms
memory: 3360kb

input:

0708

output:

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

result:

ok 4 lines

Test #4:

score: 0
Accepted
time: 1ms
memory: 3344kb

input:

0909

output:

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

result:

ok 4 lines

Test #5:

score: 0
Accepted
time: 2ms
memory: 3272kb

input:

0000

output:

. .   . . 
. .   . . 
. .   . . 
. .   . . 

result:

ok 4 lines

Test #6:

score: 0
Accepted
time: 2ms
memory: 3292kb

input:

0001

output:

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

result:

ok 4 lines

Test #7:

score: 0
Accepted
time: 2ms
memory: 3364kb

input:

0100

output:

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

result:

ok 4 lines

Test #8:

score: 0
Accepted
time: 2ms
memory: 3356kb

input:

2300

output:

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

result:

ok 4 lines

Test #9:

score: 0
Accepted
time: 2ms
memory: 3396kb

input:

2359

output:

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

result:

ok 4 lines

Test #10:

score: 0
Accepted
time: 2ms
memory: 3360kb

input:

1757

output:

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

result:

ok 4 lines

Test #11:

score: 0
Accepted
time: 2ms
memory: 3404kb

input:

0959

output:

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

result:

ok 4 lines

Test #12:

score: 0
Accepted
time: 2ms
memory: 3404kb

input:

2007

output:

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

result:

ok 4 lines

Test #13:

score: 0
Accepted
time: 1ms
memory: 3400kb

input:

2244

output:

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

result:

ok 4 lines

Test #14:

score: 0
Accepted
time: 2ms
memory: 3276kb

input:

1939

output:

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

result:

ok 4 lines

Test #15:

score: 0
Accepted
time: 0ms
memory: 3352kb

input:

0117

output:

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

result:

ok 4 lines

Test #16:

score: 0
Accepted
time: 1ms
memory: 3328kb

input:

0220

output:

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

result:

ok 4 lines

Test #17:

score: 0
Accepted
time: 2ms
memory: 3356kb

input:

1354

output:

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

result:

ok 4 lines

Test #18:

score: 0
Accepted
time: 2ms
memory: 3328kb

input:

1201

output:

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

result:

ok 4 lines

Test #19:

score: 0
Accepted
time: 0ms
memory: 3308kb

input:

1902

output:

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

result:

ok 4 lines

Test #20:

score: 0
Accepted
time: 2ms
memory: 3384kb

input:

2229

output:

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

result:

ok 4 lines

Test #21:

score: 0
Accepted
time: 2ms
memory: 3340kb

input:

0749

output:

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

result:

ok 4 lines

Test #22:

score: 0
Accepted
time: 2ms
memory: 3356kb

input:

1957

output:

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

result:

ok 4 lines

Test #23:

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

input:

0019

output:

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

result:

ok 4 lines

Test #24:

score: 0
Accepted
time: 2ms
memory: 3312kb

input:

1127

output:

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

result:

ok 4 lines

Test #25:

score: 0
Accepted
time: 2ms
memory: 3408kb

input:

1502

output:

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

result:

ok 4 lines

Test #26:

score: 0
Accepted
time: 1ms
memory: 3336kb

input:

1615

output:

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

result:

ok 4 lines

Test #27:

score: 0
Accepted
time: 2ms
memory: 3272kb

input:

1900

output:

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

result:

ok 4 lines

Test #28:

score: 0
Accepted
time: 2ms
memory: 3284kb

input:

0830

output:

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

result:

ok 4 lines