Compile Error
foo.cc: In function 'int main()': foo.cc:23:21: error: conflicting declaration 'int n' 23 | int n=(int)b.size(); | ^ foo.cc:12:27: note: previous declaration as 'long long int n' 12 | long long n,m,k; | ^
Code
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
long long n,m,k;
cin>>n>>m>>k;
long long count=0;
long long maxio=0;
vector<long long>b;
if(n%2!=0) b.push_back(n);
else count+=n;
if(m%2!=0) b.push_back(m);
else count+=m;
if(k%2!=0) b.push_back(k);
else count+=k;
int n=(int)b.size();
for(int i=0;i<n;i++)
{
maxio=max(maxio,b[i]);
}
count+=maxio;
cout<<count<<endl;
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1195 B. Palindrome
- Contest
- Brain Booster #10
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-06-13 15:53:26
- Judged At
- 2025-06-13 15:53:26
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes