Submission #105599

#TimeUsernameProblemLanguageResultExecution timeMemory
105599luciocfSequence (BOI14_sequence)C++14
9 / 100
4 ms384 KiB
#include <bits/stdc++.h> using namespace std; const int maxn = 1e3+10; int n; int a[maxn]; bool brute(int v) { for (int i = 0; i < n; i++) { int aux = v; bool ok = 0; while (aux > 0) { if (aux%10 == a[i]) ok = 1; aux /= 10; } if (!ok) return 0; v++; } return 1; } int main(void) { scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d", &a[i]); for (int i = 1; i <= 1000; i++) { if (brute(i)) { printf("%d\n", i); return 0; } } }

Compilation message (stderr)

sequence.cpp: In function 'int main()':
sequence.cpp:33:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
  ~~~~~^~~~~~~~~~
sequence.cpp:36:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &a[i]);
   ~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...