Submission #107642

#TimeUsernameProblemLanguageResultExecution timeMemory
107642dfistricSequence (BOI14_sequence)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a); i >= (b); i--)
#define REP(i, n) FOR(i, 0, n)
#define ll long long

using namespace std;

const int MAXN = 100100;
int arr[MAXN];

int main() {
    ios_base::sync_with_stdio(false);
 
    int n;
    cin >> n;
    REP(i, n) cin >> arr[i];
    
    n--;
    int t = 1;
    while (t < n) t *= 10;

    if (arr[i] == 0) cout << 10 * t << "\n";
    else             cout << arr[i] * t << "\n";

    return 0;
}

Compilation message (stderr)

sequence.cpp: In function 'int main()':
sequence.cpp:24:13: error: 'i' was not declared in this scope
     if (arr[i] == 0) cout << 10 * t << "\n";
             ^