Compile Error
foo.cc:39:2: error: stray '#' in program 39 | }#include <bits/stdc++.h> | ^ foo.cc:39:3: error: 'include' does not name a type 39 | }#include <bits/stdc++.h> | ^~~~~~~ foo.cc:50:6: error: redefinition of 'void messi()' 50 | void messi() | ^~~~~ foo.cc:12:6: note: 'void messi()' previously defined here 12 | void messi() | ^~~~~ foo.cc:66:5: error: redefinition of 'int main()' 66 | int main() | ^~~~ foo.cc:28:5: note: 'int main()' previously defined here 28 | int main() | ^~~~
Code
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define sp " "
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl
#define no cout << "no" << endl
void messi()
{
string s;
cin >> s;
while (s.length() > 1)
{
for (int i = 0; i < s.size(); i++)
{
if (i % 2 == 1)
{
s.erase(s.begin() + i);
}
}
}
cout << s << endl;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
ll tc = 1;
cin >> tc;
while (tc--)
{
messi();
}
return 0;
}#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define sp " "
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl
#define no cout << "no" << endl
void messi()
{
string s;
cin >> s;
while (s.length() > 1)
{
for (int i = 0; i < s.size(); i++)
{
if (i % 2 == 1)
{
s.erase(s.begin() + i);
}
}
}
cout << s << endl;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
ll tc = 1;
cin >> tc;
while (tc--)
{
messi();
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1080 String Algorithm
- Contest
- Bangladesh 2.0
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2024-08-16 15:40:46
- Judged At
- 2024-11-11 03:18:05
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes