이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
typedef long long ll;
using namespace std;
int n;
int arr[1005] = {0};
bool check(int x,int d)
{
while(x>0)
{
if(x%10==d) return true;
x/=10;
}
return false;
}
bool tryposs(int curr)
{
for(int i=0;i<n;i++)
{
if(check(curr+i,arr[i])==false) return false;
}
return true;
}
void solve()
{
cin >> n;
for(int i=0;i<n;i++) cin >> arr[i];
for(int i=1;i<=1000;i++)
{
if(tryposs(i))
{
cout << i << endl;
return;
}
}
return;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int tc=1;
//cin>>tc;
for(int i=1;i<=tc;i++) solve();
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |