QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#53670 | #2920. Ultimate Binary Watch | abdelrahman001# | AC ✓ | 3ms | 3724kb | C++ | 1.2kb | 2022-10-05 18:08:00 | 2022-10-05 18:08:02 |
Judging History
answer
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
const int N = 1e4 + 5;
string s;
char c[4][10];
int main() {
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
for(int i = 0;i < 4;i++) {
for(int j = 0;j < 10;j++)
c[i][j] = ' ';
}
cin >> s;
for(int i = 0;i < s.size();i++) {
int x = s[i] - '0';
int row = 0;
int col = 0;
if(i == 1)
col = 2;
else if(i == 2)
col = 6;
else if(i == 3)
col = 8;
vector<int> v;
while(x) {
v.push_back(x & 1);
x /= 2;
}
while(v.size() < 4)
v.push_back(0);
reverse(v.begin(), v.end());
for(int j = 0;j < v.size();j++)
c[j][col] = v[j] ? '*' : '.';
}
for(int i = 0;i < 4;i++) {
for(int j = 0;j < 9;j++)
cout << c[i][j];
if(i != 3)
cout << '\n';
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 3636kb
input:
1234
output:
. . . . . . . * . * * . * . * .
result:
ok 4 lines
Test #2:
score: 0
Accepted
time: 2ms
memory: 3612kb
input:
0056
output:
. . . . . . * * . . . * . . * .
result:
ok 4 lines
Test #3:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
0708
output:
. . . * . * . . . * . . . * . .
result:
ok 4 lines
Test #4:
score: 0
Accepted
time: 2ms
memory: 3628kb
input:
0909
output:
. * . * . . . . . . . . . * . *
result:
ok 4 lines
Test #5:
score: 0
Accepted
time: 2ms
memory: 3648kb
input:
0000
output:
. . . . . . . . . . . . . . . .
result:
ok 4 lines
Test #6:
score: 0
Accepted
time: 2ms
memory: 3552kb
input:
0001
output:
. . . . . . . . . . . . . . . *
result:
ok 4 lines
Test #7:
score: 0
Accepted
time: 2ms
memory: 3640kb
input:
0100
output:
. . . . . . . . . . . . . * . .
result:
ok 4 lines
Test #8:
score: 0
Accepted
time: 2ms
memory: 3724kb
input:
2300
output:
. . . . . . . . * * . . . * . .
result:
ok 4 lines
Test #9:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
2359
output:
. . . * . . * . * * . . . * * *
result:
ok 4 lines
Test #10:
score: 0
Accepted
time: 2ms
memory: 3556kb
input:
1757
output:
. . . . . * * * . * . * * * * *
result:
ok 4 lines
Test #11:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
0959
output:
. * . * . . * . . . . . . * * *
result:
ok 4 lines
Test #12:
score: 0
Accepted
time: 2ms
memory: 3632kb
input:
2007
output:
. . . . . . . * * . . * . . . *
result:
ok 4 lines
Test #13:
score: 0
Accepted
time: 2ms
memory: 3624kb
input:
2244
output:
. . . . . . * * * * . . . . . .
result:
ok 4 lines
Test #14:
score: 0
Accepted
time: 2ms
memory: 3644kb
input:
1939
output:
. * . * . . . . . . * . * * * *
result:
ok 4 lines
Test #15:
score: 0
Accepted
time: 2ms
memory: 3624kb
input:
0117
output:
. . . . . . . * . . . * . * * *
result:
ok 4 lines
Test #16:
score: 0
Accepted
time: 2ms
memory: 3492kb
input:
0220
output:
. . . . . . . . . * * . . . . .
result:
ok 4 lines
Test #17:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
1354
output:
. . . . . . * * . * . . * * * .
result:
ok 4 lines
Test #18:
score: 0
Accepted
time: 2ms
memory: 3560kb
input:
1201
output:
. . . . . . . . . * . . * . . *
result:
ok 4 lines
Test #19:
score: 0
Accepted
time: 1ms
memory: 3628kb
input:
1902
output:
. * . . . . . . . . . * * * . .
result:
ok 4 lines
Test #20:
score: 0
Accepted
time: 2ms
memory: 3624kb
input:
2229
output:
. . . * . . . . * * * . . . . *
result:
ok 4 lines
Test #21:
score: 0
Accepted
time: 2ms
memory: 3556kb
input:
0749
output:
. . . * . * * . . * . . . * . *
result:
ok 4 lines
Test #22:
score: 0
Accepted
time: 2ms
memory: 3548kb
input:
1957
output:
. * . . . . * * . . . * * * * *
result:
ok 4 lines
Test #23:
score: 0
Accepted
time: 2ms
memory: 3492kb
input:
0019
output:
. . . * . . . . . . . . . . * *
result:
ok 4 lines
Test #24:
score: 0
Accepted
time: 3ms
memory: 3608kb
input:
1127
output:
. . . . . . . * . . * * * * . *
result:
ok 4 lines
Test #25:
score: 0
Accepted
time: 2ms
memory: 3536kb
input:
1502
output:
. . . . . * . . . . . * * * . .
result:
ok 4 lines
Test #26:
score: 0
Accepted
time: 2ms
memory: 3552kb
input:
1615
output:
. . . . . * . * . * . . * . * *
result:
ok 4 lines
Test #27:
score: 0
Accepted
time: 3ms
memory: 3628kb
input:
1900
output:
. * . . . . . . . . . . * * . .
result:
ok 4 lines
Test #28:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
0830
output:
. * . . . . . . . . * . . . * .
result:
ok 4 lines