Chiranjeevi
One more thing, i have 5 elements in the map, but after inserting them into set using comparator function i have only 2 elements in the set. Why is that? My main aim is to sort them, but i am losing elements here.
Anonymous
Use std::multiset or std::vector with std::sort
かめ
Chiranjeevi
Thanks, but i thought the uniqueness is checked by the pair as a whole, never thought the uniqueness is checked using only value.
Anonymous
khyrull
hello guys
MᏫᎻᎯᎷᎷᎬᎠ
std::array is code-bloat
Ilya
klimi
Anonymous
hey
Anya
Hello i wanna start programming with c who can help me?
Francisco
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
Yeah it's a warning
Pretty enough
Mauryain™️
MᏫᎻᎯᎷᎷᎬᎠ
And very small cases
Where bound safety is guaranteed
Francisco
Also, clang-tidy warns when using C-style arrays, and recommends std::array
Anonymous
MᏫᎻᎯᎷᎷᎬᎠ
Anonymous
vla = variable-length arrays
Anonymous
Also, what do you mean when you say std::array is code bloat?
MᏫᎻᎯᎷᎷᎬᎠ
Everytime, an instantiation of class happens
Anonymous
oh
MᏫᎻᎯᎷᎷᎬᎠ
class array<int, 5>{};
class array<int, 7>{};
class array<int, 10>{};
MᏫᎻᎯᎷᎷᎬᎠ
I mean
Wtf
No body wants that
Francisco
I mean
Wtf
No body wants that
And what do you propose? The good thing about std::array is its interface and compatibility with the rest of the containers. Also, the size must be known at compile time, otherwise it's an error
Francisco
And it doesn't decay to a pointer
Rashi
#include<stdio.h>
int main()
{
int t,j;
long int n,i;
int s[100000][10];
scanf("%d",&t);
while(t--){
scanf("%ld",&n);
for(i=1;i<=n;i++){
for(j=1;j<=10;j++){
scanf("%d",&s[i][j]);
}
}
for(i=1;i<=n;i++){
for(j=1;j<=10;j++){
printf("%d\n",s[i][j]);
}
}
}
return 0;
}
Rashi
Hello everyone, I am facing problem in printing this 2-D array..The last element is not getting printed correctly .. Can anyone help?
Ilya
Rashi
#include<stdio.h>
int main()
{
int t,j;
long int n,i;
int s[100000][10];
scanf("%d",&t);
while(t--){
scanf("%ld",&n);
for(i=0;i<n;i++){
for(j=0;j<9;j++){
scanf("%d",&s[i][j]);
}
}
for(i=0;i<n;i++){
for(j=0;j<10;j++){
printf("%d\n",s[i][j]);
}
}
}
return 0;
}
Rashi
This code is also giving same output
Rashi
problem is occuring in only those values which are starting with 0
Rashi
For example ,
If I enter
1
4
1110001101
1010101011
0000000011
1111100000
0000111110
As input ,
then first second and fourth string is printing fine , but not third and fifth
01000001011011010100000101101110
Is this from on going contest?
Anonymous
what's the output? and what were you expecting?
Anonymous
you never actually mentioned what the program was supposed to do, just that there's a problem.
01000001011011010100000101101110
It's from on going contest
01000001011011010100000101101110
Ask for link of the Problem
Ilya
Rashi
#include<stdio.h>
int main()
{
int t,j;
long int n,i;
int s[100000][10];
scanf("%d",&t);
while(t--){
scanf("%ld",&n);
for(i=0;i<n;i++){
for(j=0;j<10;j++){
scanf("%d",&s[i][j]);
}
}
for(i=0;i<n;i++){
for(j=0;j<10;j++){
printf("%d\n",s[i][j]);
}
}
}
return 0;
}
Rashi
This is the code
Rashi
1
5
1110001101
1010101011
0000000011
1111100000
0000111110 This is input
Rashi
1110001101
1010101011
0000000011
1111100000
0000111110 This is expected output
Rashi
1110001101
1010101011
11
1111100000
111110
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Rashi
This is what i am getting
I_Interface
This is what i am getting
Names of variables - terrible.
int s[1000000][10]; - terrible.
Code reading - terrible.
Dima
Dima
read the rules
I_Interface
Anonymous
>:(
Anonymous
/command
Anonymous
!ban
Rashi
Sorry . I will never ask anything here from now .
Ander
Anonymous
someone with some revision notes and papers on c++ program i go through please in preparation for my exams
Anonymous
Anonymous
Ander
Ketan
Hi
Pradeep Kumar
Hii
Anonymous
Ander
Anonymous
there isn't an error, you just can't use the api without https
Ander
H̲i̲L̲e̲v̲e̲l̲
Also you can use telegram api without webhook, through the long poll
Ander
H̲i̲L̲e̲v̲e̲l̲
But it's c#
Anya
what is the best way to start c?
which source or book or video tutorial?
Anonymous