#include <bits/stdc++.h>
// author: aykhn
using namespace std;
typedef long long ll;
#define TC int t; cin >> t; while (t--) _();
#define OPT ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(v) v.begin(), v.end()
#define pii pair<int, int>
#define mpr make_pair
#define eb emplace_back
#define pb push_back
#define ts to_string
#define fi first
#define se second
#define ins insert
#define int ll
#define inf 0x3F3F3F3F
#define infll 0x3F3F3F3F3F3F3F3FLL
#define bpc __builtin_popcount
bool ok(int val, int x)
{
if (!val && !x) return true;
while (val)
{
if (val % 10 == x) return true;
val /= 10;
}
return false;
}
signed main()
{
OPT;
for (int i = 1; i <= 7; i++)
{
for (int j = 1; j <= 49; j++)
{
//cout << 1 << " ";
}
//cout << endl;
}
int n;
cin >> n;
int x;
for (int i = 0; i < n; i++) cin >> x;
for (int i = 0; 1; i++)
{
bool flag = true;
for (int j = 0; j < n; j++)
{
if (!ok(i + j, x)) flag = false;
}
if (flag)
{
cout << i << endl;
return 0;
}
}
int k = 1;
while (n / k && n != k) k *= 10;
if (!x) cout << k * 10 << endl; else
cout << x * k << endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |