QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#96211 | #2920. Ultimate Binary Watch | Abdelrahman_K# | AC ✓ | 3ms | 3448kb | C++14 | 910b | 2023-04-13 17:10:39 | 2023-04-13 17:10:43 |
Judging History
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() {
string n;
cin>>n;
vector<int> vec[4];
int i = 3;
while(n.size()){
int x = n.back() - '0';
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--;
n.pop_back();
}
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;
}
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 3300kb
input:
1234
output:
. . . . . . . * . * * . * . * .
result:
ok 4 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3328kb
input:
0056
output:
. . . . . . * * . . . * . . * .
result:
ok 4 lines
Test #3:
score: 0
Accepted
time: 1ms
memory: 3360kb
input:
0708
output:
. . . * . * . . . * . . . * . .
result:
ok 4 lines
Test #4:
score: 0
Accepted
time: 2ms
memory: 3364kb
input:
0909
output:
. * . * . . . . . . . . . * . *
result:
ok 4 lines
Test #5:
score: 0
Accepted
time: 2ms
memory: 3328kb
input:
0000
output:
. . . . . . . . . . . . . . . .
result:
ok 4 lines
Test #6:
score: 0
Accepted
time: 2ms
memory: 3448kb
input:
0001
output:
. . . . . . . . . . . . . . . *
result:
ok 4 lines
Test #7:
score: 0
Accepted
time: 3ms
memory: 3340kb
input:
0100
output:
. . . . . . . . . . . . . * . .
result:
ok 4 lines
Test #8:
score: 0
Accepted
time: 2ms
memory: 3404kb
input:
2300
output:
. . . . . . . . * * . . . * . .
result:
ok 4 lines
Test #9:
score: 0
Accepted
time: 0ms
memory: 3424kb
input:
2359
output:
. . . * . . * . * * . . . * * *
result:
ok 4 lines
Test #10:
score: 0
Accepted
time: 2ms
memory: 3368kb
input:
1757
output:
. . . . . * * * . * . * * * * *
result:
ok 4 lines
Test #11:
score: 0
Accepted
time: 2ms
memory: 3440kb
input:
0959
output:
. * . * . . * . . . . . . * * *
result:
ok 4 lines
Test #12:
score: 0
Accepted
time: 2ms
memory: 3336kb
input:
2007
output:
. . . . . . . * * . . * . . . *
result:
ok 4 lines
Test #13:
score: 0
Accepted
time: 2ms
memory: 3340kb
input:
2244
output:
. . . . . . * * * * . . . . . .
result:
ok 4 lines
Test #14:
score: 0
Accepted
time: 0ms
memory: 3360kb
input:
1939
output:
. * . * . . . . . . * . * * * *
result:
ok 4 lines
Test #15:
score: 0
Accepted
time: 2ms
memory: 3332kb
input:
0117
output:
. . . . . . . * . . . * . * * *
result:
ok 4 lines
Test #16:
score: 0
Accepted
time: 2ms
memory: 3332kb
input:
0220
output:
. . . . . . . . . * * . . . . .
result:
ok 4 lines
Test #17:
score: 0
Accepted
time: 2ms
memory: 3424kb
input:
1354
output:
. . . . . . * * . * . . * * * .
result:
ok 4 lines
Test #18:
score: 0
Accepted
time: 2ms
memory: 3436kb
input:
1201
output:
. . . . . . . . . * . . * . . *
result:
ok 4 lines
Test #19:
score: 0
Accepted
time: 1ms
memory: 3432kb
input:
1902
output:
. * . . . . . . . . . * * * . .
result:
ok 4 lines
Test #20:
score: 0
Accepted
time: 0ms
memory: 3356kb
input:
2229
output:
. . . * . . . . * * * . . . . *
result:
ok 4 lines
Test #21:
score: 0
Accepted
time: 2ms
memory: 3292kb
input:
0749
output:
. . . * . * * . . * . . . * . *
result:
ok 4 lines
Test #22:
score: 0
Accepted
time: 2ms
memory: 3328kb
input:
1957
output:
. * . . . . * * . . . * * * * *
result:
ok 4 lines
Test #23:
score: 0
Accepted
time: 2ms
memory: 3440kb
input:
0019
output:
. . . * . . . . . . . . . . * *
result:
ok 4 lines
Test #24:
score: 0
Accepted
time: 2ms
memory: 3444kb
input:
1127
output:
. . . . . . . * . . * * * * . *
result:
ok 4 lines
Test #25:
score: 0
Accepted
time: 1ms
memory: 3400kb
input:
1502
output:
. . . . . * . . . . . * * * . .
result:
ok 4 lines
Test #26:
score: 0
Accepted
time: 2ms
memory: 3412kb
input:
1615
output:
. . . . . * . * . * . . * . * *
result:
ok 4 lines
Test #27:
score: 0
Accepted
time: 2ms
memory: 3356kb
input:
1900
output:
. * . . . . . . . . . . * * . .
result:
ok 4 lines
Test #28:
score: 0
Accepted
time: 2ms
memory: 3436kb
input:
0830
output:
. * . . . . . . . . * . . . * .
result:
ok 4 lines