Submission #1384503


Source Code Expand

#include <bits/stdc++.h>

using namespace std;

#define forn(i, s, f) for(int i = (s); i <= (f); ++i)
#define for1(i, f, s) for(int i = (f); i >= (s); --i)
#define fora(i, x) for (auto i : x)
#define show(x) cout << #x << " = " << x << " ";
#define skip continue;
#define pb push_back
#define _1 first
#define _2 second

typedef long long ll;

const int N3 = 1e3 + 5;
const int N4 = 1e4 + 5;
const int N5 = 1e5 + 5;
const int N6 = 1e6 + 5;
const int N7 = 1e7 + 5;
const int N8 = 1e8 + 5;
const int N9 = 1e9 + 5;
const int mod = N9 + 2;

int ans, a[8], x, res;

int main()
{
    forn (i, 1, 7)
        cin >> a[i], b[i] = a[i];
    x = min({a[1], a[4], a[5]});
    ans += x;
    a[1] -= x, a[4] -= x, a[5] -= x;
    res = b[1] - (b[1] % 2 == 1);
    res *= 2;
    if (b[1] && b[4] && b[5])
        ++res;
    cout << max(ans, res) + a[2];
}

Submission Info

Submission Time
Task C - Tetromino Tiling
User Bruteforcer_
Language C++14 (GCC 5.4.1)
Score 0
Code Size 881 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:31:22: error: ‘b’ was not declared in this scope
         cin >> a[i], b[i] = a[i];
                      ^
./Main.cpp:35:11: error: ‘b’ was not declared in this scope
     res = b[1] - (b[1] % 2 == 1);
           ^