QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#718456 | #3567. Digital Clock | Odyssey | 0 | 100ms | 3604kb | C++23 | 4.5kb | 2024-11-06 20:33:53 | 2024-11-06 20:33:58 |
Judging History
answer
/////简洁
//#define _CRT_SECURE_NO_WARNINGS
//#include<bits/stdc++.h>
//using namespace std;
//#define int long long
//#define LL long long
//#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
//const int N = 1e6 + 9;
//int n;
//int digit[] =
//{
// 0b1111110, // 0
// 0b0110000, // 1
// 0b1101101, // 2
// 0b1111001, // 3
// 0b0110011, // 4
// 0b1011011, // 5
// 0b1011111, // 6
// 0b1110000, // 7
// 0b1111111, // 8
// 0b1111011 // 9
//};
//
////vector<int> changestoi(string s)
////{
//// vector<int>di;
//// /*int hh = stoi(s.substr(0, 2));
//// int mm = stoi(s.substr(3, 2));*/
//// for (int i = 0; i <= 4; i++)
//// {
//// if (i == 3)continue;
//// digit.push_back(s[i] - '0');
//// }
//// return di;
////}
//
//bool isson(string look,string real)
//{
// for (int i = 0; i <=4; i++)
// {
// //cout<<look[i]<<" "<<real[i]<<endl;
// if (i == 2)continue;
// int x = look[i] - '0', y = real[i] - '0';
// if ((digit[x] & digit[y]) != digit[x])
// {
// return false;
// }
// }
// return true;
//}
//
//vector<string> all(int n, vector<string>ob)
//{
// vector<string>res;
//
// for (int i = 0; i < 24; i++)
// {
// for (int j = 0; j < 60; j++)
// {
// int h = i, m = j;
// int flag = 1;
// string now,start;
// for (int cnt = 0; cnt <n; cnt++)
// {
// ostringstream oss;
// oss << setfill('0') << setw(2) << h << ':' << setfill('0') << setw(2) << m;
// now = oss.str();
// if (cnt == 0)start = now;
// //cout << now << endl;
// if (!isson(ob[cnt], now))
// {
// //cout << cnt << " " << ob[cnt] << " " << now << endl;
// flag=0;
// break;
// }
// m++;
// if (m == 60)
// {
// m = 0;
// h = (h + 1) % 24;
// }
// }
//
// if (flag)
// {
// res.push_back(start);
// }
// }
// }
// return res;
//}
//
//void solve()
//{
// while (cin >> n)
// {
// vector<string>ob(n);
// for (int i = 0; i <n; i++)
// {
// cin >> ob[i];
// }
// vector<string>ans = all(n, ob);
// if (ans.empty())
// {
// cout << "none\n";
// }
// else
// {
// for (int i = 0; i < ans.size(); i++)
// {
// if (i > 0)cout << " ";
// cout << ans[i] ;
// }
// cout << "\n";
// }
//
// }
//}
//signed main()
//{
// //IOS;
// int tt = 1;
// //cin >> tt;
// while (tt--)
// {
// solve();
// }
// return 0;
//}
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
const int N = 1e6 + 9;
int n;
int digit[] = {
0b1111110, // 0
0b0110000, // 1
0b1101101, // 2
0b1111001, // 3
0b0110011, // 4
0b1011011, // 5
0b1011111, // 6
0b1110000, // 7
0b1111111, // 8
0b1111011 // 9
};
bool isson(const string& look, const string& real) {
for (int i = 0; i <= 4; i++) {
if (i == 2) continue;
int x = look[i] - '0', y = real[i] - '0';
if ((digit[x] & digit[y]) != digit[x]) {
return false;
}
}
return true;
}
vector<string> all(int n, const vector<string>& ob) {
vector<string> res;
for (int i = 0; i < 24; i++) {
for (int j = 0; j < 60; j++) {
int h = i, m = j;
bool flag = true;
string now, start;
for (int cnt = 0; cnt < n; cnt++) {
ostringstream oss;
oss << setfill('0') << setw(2) << h << ':' << setfill('0') << setw(2) << m;
now = oss.str();
if (cnt == 0) start = now;
if (!isson(ob[cnt], now)) {
flag = false;
break;
}
m++;
if (m == 60) {
m = 0;
h = (h + 1) % 24;
}
}
if (flag) {
res.push_back(start);
}
}
}
return res;
}
void solve() {
while (cin >> n) {
vector<string> ob(n);
for (int i = 0; i < n; i++) {
cin >> ob[i];
}
vector<string> ans = all(n, ob);
if (ans.empty()) {
cout << "none\n";
}
else {
for (size_t i = 0; i < ans.size(); i++) {
if (i > 0) cout << " ";
cout << ans[i];
}
cout << "\n";
}
}
}
int main() {
IOS;
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Pretests
Final Tests
Test #1:
score: 0
Wrong Answer
time: 100ms
memory: 3604kb
input:
1 88:88 2 23:25 23:26 3 71:57 71:57 71:07 1 00:00 1 11:11 1 22:22 1 33:33 1 44:44 1 55:55 1 66:66 1 77:77 1 88:88 1 99:99 1 08:28 1 78:48 1 24:11 1 31:11 1 11:60 5 23:11 23:11 23:11 23:11 23:11 6 23:11 23:11 23:11 23:11 23:11 23:11 6 23:11 23:11 23:11 23:11 23:11 23:12 2 08:19 08:20 2 27:77 27:17 2 ...
output:
none 23:25 00:58 03:58 07:58 08:58 00:00 00:08 08:00 08:08 00:00 00:01 00:03 00:04 00:07 00:08 00:09 00:10 00:11 00:13 00:14 00:17 00:18 00:19 00:30 00:31 00:33 00:34 00:37 00:38 00:39 00:40 00:41 00:43 00:44 00:47 00:48 00:49 01:00 01:01 01:03 01:04 01:07 01:08 01:09 01:10 01:11 01:13 01:14 01:17 0...
result:
wrong answer 21st lines differ - expected: 'none', found: '23:07 23:37'