제출 #1213762

#제출 시각아이디문제언어결과실행 시간메모리
1213762badge881Nadan (COCI18_nadan)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e6 + 4; const int MOD = 1e9 + 7; vector<int> add[MAXN]; int main() { int k, n; cin >> k >> n; vector<int> v(n + 1); ll sum = 0; for(int i = 1; i <= n; i++){ if(i == n) v[i] = k - sum; else v[i] = i; sum += i; } for(int i = 1; i <= n; i++) cout << v[i] << "\n"; return 0; }

컴파일 시 표준 에러 (stderr) 메시지

nadan.cpp: In function 'int main()':
nadan.cpp:13:5: error: 'll' was not declared in this scope
   13 |     ll sum = 0;
      |     ^~
nadan.cpp:17:24: error: 'sum' was not declared in this scope
   17 |             v[i] = k - sum;
      |                        ^~~
nadan.cpp:20:9: error: 'sum' was not declared in this scope
   20 |         sum += i;
      |         ^~~