Submission #3780257
Source Code Expand
#include<bits/stdc++.h> using namespace std; map<int,int>mp; int a[10]; int main() { int n,k; scanf("%d%d",&n,&k); for(int i=0;i<k;i++) { int x; scanf("%d",&x); mp[x]=1; } int t=n; while(true) { int tt=t; bool f=true; while(tt) { if(mp[tt%10])f=false; tt/=10; } if(f)break; t++; } printf("%d",t); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Iroha's Obsession |
User | higiri_27 |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 376 Byte |
Status | AC |
Exec Time | 8 ms |
Memory | 256 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:8:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d",&n,&k); ^ ./Main.cpp:12:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&x); ^
Judge Result
Set Name | Sample | All | ||
---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||
Status | AC |
|
Set Name | Test Cases |
---|---|
Sample | |
All | subtask0_sample_01.txt, subtask0_sample_02.txt, subtask1_X_01.txt, subtask1_X_02.txt, subtask1_X_03.txt, subtask1_X_04.txt, subtask1_X_05.txt, subtask1_X_06.txt, subtask1_X_07.txt, subtask1_X_08.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
subtask0_sample_01.txt | AC | 1 ms | 256 KB |
subtask0_sample_02.txt | AC | 1 ms | 256 KB |
subtask1_X_01.txt | AC | 2 ms | 256 KB |
subtask1_X_02.txt | AC | 8 ms | 256 KB |
subtask1_X_03.txt | AC | 2 ms | 256 KB |
subtask1_X_04.txt | AC | 1 ms | 256 KB |
subtask1_X_05.txt | AC | 1 ms | 256 KB |
subtask1_X_06.txt | AC | 2 ms | 256 KB |
subtask1_X_07.txt | AC | 1 ms | 256 KB |
subtask1_X_08.txt | AC | 1 ms | 256 KB |