Submission #1157119

#TimeUsernameProblemLanguageResultExecution timeMemory
1157119tamzidStove (JOI18_stove)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

void solve()
{
    int n,
    cin>>n>>k;
    vii t(n);
    for(int i=0;i<n;++i)
    {
        cin>>t[i];
    }
    if(k==1) cout<<t[n-1]-t[0];
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    //int t;cin>>t;while(t--)
        solve();

    return 0;
}

Compilation message (stderr)

stove.cpp: In function 'void solve()':
stove.cpp:7:8: error: expected initializer before '>>' token
    7 |     cin>>n>>k;
      |        ^~
stove.cpp:8:5: error: 'vii' was not declared in this scope
    8 |     vii t(n);
      |     ^~~
stove.cpp:11:14: error: 't' was not declared in this scope
   11 |         cin>>t[i];
      |              ^
stove.cpp:13:8: error: 'k' was not declared in this scope
   13 |     if(k==1) cout<<t[n-1]-t[0];
      |        ^
stove.cpp:13:20: error: 't' was not declared in this scope
   13 |     if(k==1) cout<<t[n-1]-t[0];
      |                    ^