답안 #767614

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
767614 2023-06-26T22:48:19 Z Pichon5 Sjekira (COCI20_sjekira) C++17
0 / 110
7 ms 1876 KB
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <string>
#include <sstream>
#include <fstream>
#include <cmath>
#include <queue>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define F first
#define S second
#define mp make_pair
#define int long long
using namespace std;

signed main(){
    fast
    //quiero sacar el factorial de 10
    int n,x,a,b;
    cin>>n;
    vi v(n+1);
    int res=0;
    for(int i=1;i<=n;i++){
        cin>>x;
        res+=x;
        if(i!=1 && i!=n)res+=x;
    }
    cout<<res<<endl;
    
    return 0;
}

Compilation message

sjekira.cpp: In function 'int main()':
sjekira.cpp:29:13: warning: unused variable 'a' [-Wunused-variable]
   29 |     int n,x,a,b;
      |             ^
sjekira.cpp:29:15: warning: unused variable 'b' [-Wunused-variable]
   29 |     int n,x,a,b;
      |               ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 1876 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -