QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#96209 | #2920. Ultimate Binary Watch | Abdelrahman_K# | RE | 0ms | 3332kb | C++14 | 887b | 2023-04-13 17:08:45 | 2023-04-13 17:08:49 |
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() {
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;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3332kb
input:
1234
output:
. . . . . . . * . * * . * . * .
result:
ok 4 lines
Test #2:
score: -100
Runtime Error
input:
0056