Submission #418933

#TimeUsernameProblemLanguageResultExecution timeMemory
418933VladMSequence (BOI14_sequence)C++14
9 / 100
1 ms332 KiB
#include <bits/stdc++.h> using namespace std; long long n, k, b[1007], flag, totflag, c; vector<long long> vec; void get_char(long long a) { vec.clear(); while(a>0) { vec.push_back(a%10); a/=10; } return; } int main() { cin>>k; for(int i=1; i<=k; i++) cin>>b[i]; for(int n=1; n<=1000; n++) { totflag=0; for(int i=1; i<=k; i++) { c=n+i-1; get_char(c); flag=0; for(int j=0; j<vec.size(); j++) { if(vec[j]==b[i]) flag=1; } if(flag==0) { totflag=1; break; } } if(totflag==0) { cout<<n<<endl; break; } } return 0; }

Compilation message (stderr)

sequence.cpp: In function 'int main()':
sequence.cpp:32:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |             for(int j=0; j<vec.size(); j++)
      |                          ~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...