Compile Error
foo.cs(10,0): error CS1024: Wrong preprocessor directive foo.cs(10,6): error CS1525: Unexpected symbol `namespace', expecting `identifier' or `static' foo.cs(10,19): error CS1525: Unexpected symbol `;', expecting `identifier' or `static' foo.cs(12,0): error CS1032: Cannot define or undefine preprocessor symbols after first token in file foo.cs(13,0): error CS1032: Cannot define or undefine preprocessor symbols after first token in file foo.cs(14,0): error CS1032: Cannot define or undefine preprocessor symbols after first token in file foo.cs(15,0): error CS1032: Cannot define or undefine preprocessor symbols after first token in file foo.cs(16,0): error CS1032: Cannot define or undefine preprocessor symbols after first token in file foo.cs(17,0): error CS1032: Cannot define or undefine preprocessor symbols after first token in file foo.cs(18,0): error CS1032: Cannot define or undefine preprocessor symbols after first token in file foo.cs(19,0): error CS1032: Cannot define or undefine preprocessor symbols after first token in file foo.cs(20,0): error CS1032: Cannot define or undefine preprocessor symbols after first token in file foo.cs(21,0): error CS1032: Cannot define or undefine preprocessor symbols after first token in file foo.cs(22,0): error CS1032: Cannot define or undefine preprocessor symbols after first token in file foo.cs(24,4): error CS1525: Unexpected symbol `string', expecting `identifier' or `static' foo.cs(25,17): error CS1525: Unexpected symbol `(', expecting `identifier' or `static' foo.cs(26,1): error CS1514: Unexpected symbol `}', expecting `.' or `{' foo.cs(29,32): error CS1525: Unexpected symbol `;'
Code
/*
**************************************************************
*Bis'Millah Hir Rah'Manir Rahim == start with the name of \n *
* ALLAH Subhana Tayala *
* Author: Md. Mahabubar Rahman *
* CSE,RPI && Rangpur, Bangladesh *
**************************************************************
*/
#include <bits/stdc++.h>
using namespace std;
#define Allhamdulillah 0
#define pb(x) push_back(x)
#define pp() pop_back()
#define ll long long int
#define foi(i, s, e) for (int i = s; i < e; i++)
#define cn(x) cin >> x
#define endl '\n'
#define Endl '\n'
#define nl cout << '\n'
#define yes cout << "YES\n"
#define no cout << "NO\n"
int sss(int n){
string s=to_string(n);
return s.size();
}
void solve()
{
int n,k;cin>>n>>k;int arr[n];for(auto &c:arr)cin>>c;
vector<string>ans;
string s="",s2;
for(int i=0;i<=k;i++)s+=to_string(arr[i]);
int start=1,j=k+1;
ans.push_back(s);
while(j<n){
s+=to_string(arr[j]);
int dlt=sss(arr[start-1]),tt=s.size();
s2=s.substr(dlt,tt-dlt);
ans.push_back(s2);
s=s2;
start++;
j++;
}
sort(ans.begin(),ans.end(),greater<string>());
cout<<ans[0]<<endl;
}
/*mdmahabub55*/
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t = 1;
cin >> t;
// t = 1;
while (t--)
{
solve();
}
return Allhamdulillah;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1083 Number concatenation
- Contest
- Bangladesh 2.0
- Language
- C# 7 (Mono 6.8)
- Submit At
- 2024-08-16 16:15:21
- Judged At
- 2024-11-11 03:15:25
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes