Submission #860776

#TimeUsernameProblemLanguageResultExecution timeMemory
860776EllinorSequence (BOI14_sequence)C++14
9 / 100
1 ms600 KiB
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("Ofast,inline") // Ofast = O3,fast-math,allow-store-data-races,no-protect-parens #pragma GCC optimize ("unroll-loops") #pragma GCC target("bmi,bmi2,lzcnt,popcnt") // bit manipulation #pragma GCC target("movbe") // byte swap #pragma GCC target("aes,pclmul,rdrnd") // encryption #pragma GCC target("avx,avx2,f16c,fma,sse3,ssse3,sse4.1,sse4.2") typedef long long ll; #define rep(i, a, b) for (int i = (a); i < int(b); i++) typedef pair<ll, ll> pll; typedef pair<int, int> pii; #define pb push_back inline void fast() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } ll INF = 1000000000; ll mod = 1e9 + 7; #define int ll #define float double // int K; vector<char> ks; int32_t main() { fast(); cin >> K; ks.assign(K, -1); rep(i,0,K) { cin >> ks[i]; } rep(n,1,1001) { bool nat = true; rep(at,0,K) { string sat = to_string(n + at); bool bat = false; rep(i,0,sat.size()) { if (sat[i] == ks[at]) { bat = true; break; } } nat = nat && bat; if (!nat) break; } if (nat) { cout << n << "\n"; exit(0); } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...