Submission #880313

# Submission time Handle Problem Language Result Execution time Memory
880313 2023-11-29T07:10:11 Z vjudge1 Bali Sculptures (APIO15_sculpture) C++17
Compilation error
0 ms 0 KB
#include <iostream>
#include <fstream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>
#include <iterator>
#include <functional>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <bitset>
#include <cstdint>
#include <cassert>
#include <functional>
#include <complex>
#include <climits>
#include <random>
using namespace std;
  
#define ll long long
#define pb push_back
#define ull unsigned long long
#define F first
#define S second
#define all(v) v.begin(), v.end() 

int a[2005];

void solve(){
    int n, a, b;
    cin >> n >> A >> B;
    int s = 0;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
        s += a[i];
    }
    if(A == 1) cout << s;
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);
    int xach = 1;   
    //cin >> xach;
    while(xach--) solve();
}
/*
 *
*/

Compilation message

sculpture.cpp: In function 'void solve()':
sculpture.cpp:45:17: error: 'A' was not declared in this scope
   45 |     cin >> n >> A >> B;
      |                 ^
sculpture.cpp:45:22: error: 'B' was not declared in this scope
   45 |     cin >> n >> A >> B;
      |                      ^
sculpture.cpp:48:17: error: invalid types 'int[int]' for array subscript
   48 |         cin >> a[i];
      |                 ^
sculpture.cpp:49:15: error: invalid types 'int[int]' for array subscript
   49 |         s += a[i];
      |               ^
sculpture.cpp:44:15: warning: unused variable 'b' [-Wunused-variable]
   44 |     int n, a, b;
      |               ^