제출 #1181865

#제출 시각아이디문제언어결과실행 시간메모리
1181865random_nameProgression (NOI20_progression)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define long long long #pragma region overloadings template <typename T1, typename T2> ostream& operator<< (ostream& os, const pair<T1, T2>& pair){ os << '(' << pair.first << ", " << pair.second << ')'; return os; } template <typename T1, typename T2> ostream& operator<< (ostream& os, const map<T1, T2>& map_var){ for(pair<T1, T2> i: map_var){ os << '(' << i.first << ": " << i.second << ") "; } return os; } template <typename T> ostream& operator<< (ostream& os, const vector<T>& vec){ for(T i: vec) os << i << ' '; return os; } template <typename T1, typename T2> istream& operator>> (istream& is, pair<T1, T2>& pair){ is >> pair.first >> pair.second; return is; } template <typename T> istream& operator>> (istream& is, vector<T>& vec){ for(int i = 0; i < vec.size(); i++) is >> vec[i]; return is; } #pragma endregion bool test_cases = false; ifstream ifile; ofstream ofile; // #define cin ifile // #define cout ofile void solution(){ int n, q; cin >> n >> q; vector<int> D(n); cin >> D; while(q--){ int op; cin >> op; switch(op){ case 1: int l, r, s, c; cin >> l >> r >> s >> c; break; case 2: int l, r, s, c; cin >> l >> r >> s >> c; break; case 3: int l, r; cin >> l >> r; cout << 1 << '\n'; break; } } } int main(){ ifile.open("circlecross.in"); ofile.open("circlecross.out"); if(test_cases){ int t; cin >> t; while(t--){ solution(); } } else{ solution(); } }

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

Progression.cpp: In function 'void solution()':
Progression.cpp:67:17: error: redeclaration of 'int l'
   67 |             int l, r, s, c;
      |                 ^
Progression.cpp:62:17: note: 'int l' previously declared here
   62 |             int l, r, s, c;
      |                 ^
Progression.cpp:67:20: error: redeclaration of 'int r'
   67 |             int l, r, s, c;
      |                    ^
Progression.cpp:62:20: note: 'int r' previously declared here
   62 |             int l, r, s, c;
      |                    ^
Progression.cpp:67:23: error: redeclaration of 'int s'
   67 |             int l, r, s, c;
      |                       ^
Progression.cpp:62:23: note: 'int s' previously declared here
   62 |             int l, r, s, c;
      |                       ^
Progression.cpp:67:26: error: redeclaration of 'int c'
   67 |             int l, r, s, c;
      |                          ^
Progression.cpp:62:26: note: 'int c' previously declared here
   62 |             int l, r, s, c;
      |                          ^
Progression.cpp:72:17: error: redeclaration of 'int l'
   72 |             int l, r;
      |                 ^
Progression.cpp:62:17: note: 'int l' previously declared here
   62 |             int l, r, s, c;
      |                 ^
Progression.cpp:72:20: error: redeclaration of 'int r'
   72 |             int l, r;
      |                    ^
Progression.cpp:62:20: note: 'int r' previously declared here
   62 |             int l, r, s, c;
      |                    ^