Submission #1693102


Source Code Expand

//#include <bits/stdc++.h>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <map>
#include <stack>
#include <bitset>
#include <array>
#include <set>
#include <string>

#include <iterator>
#include <algorithm>
#include <numeric>

#include <ios>
#include <sstream>
#include <iostream>
#include <fstream>
#include <climits>


using namespace std;

using ll=long long;

using vi=vector<int>;
using vvi=vector<vi>;
using vs=vector<string>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;

void OUT(bool isTrue, string t="YES", string f="NO"){
    cout<<(isTrue?t:f)<<endl;
}
void out(bool isTrue, string t="yes", string f="yes"){
    cout<<(isTrue?t:f)<<endl;
}

template <typename T>
string printItr(T b, T e, string delim=" ")
{
    stringstream ss;
    ostream_iterator<decltype(*b)> out_it(ss, delim.c_str());
    copy(b,e - 1, out_it);
    ss<<*(e-1);
    return ss.str();
}

void bulk(){}
template <class Head, class... Tail>
void bulk(Head& head, Tail&... tail){
    cin>>head;
    bulk(tail...);
}

#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define range(i,m,n) for(int i=m; i<n;i++)
#define each(i,n) for(auto i:n)
#define all(i) i.begin(),i.end()
#define cint(...) int __VA_ARGS__;bulk(__VA_ARGS__);

int main(void){
    cint(n,k);
    vi a(k),b;
    rep(i,k){cin>>a[i];}
    rep(i,10){if(find(all(a),i)==a.end())b.push_back(i);}
    b.push_back(b[0]+10);
    rep(i,(int)log10(n)+1){
        int p=n/((int)pow(10,i))%10;
        n+=(*lower_bound(all(b),p)-p)*(int)pow(10,i);
    }
    cout<<n;
}

Submission Info

Submission Time
Task C - Iroha's Obsession
User plcherrim
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1641 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:71:23: error: ‘log10’ was not declared in this scope
     rep(i,(int)log10(n)+1){
                       ^
./Main.cpp:58:32: note: in definition of macro ‘rep’
 #define rep(i,n) for(int i=0;i<n;i++)
                                ^
./Main.cpp:72:31: error: ‘pow’ was not declared in this scope
         int p=n/((int)pow(10,i))%10;
                               ^