제출 #1157119

#제출 시각아이디문제언어결과실행 시간메모리
1157119tamzidStove (JOI18_stove)C++20
컴파일 에러
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; }

컴파일 시 표준 에러 (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];
      |                    ^