YK Y
Good for you So what?
but unable to write the code
YK Y
for it
Anonymous
but unable to write the code
Bad for you, so what?
Talula
but unable to write the code
Normally I can understand things only if I can write code for it.
YK Y
Bad for you, so what?
i need some help, so i text in the group!
Talula
i need some help, so i text in the group!
I could help you out if you want.
Rohan
i think you cant
Thanks for info
Anonymous
Can anyone explain this a bit for me : cout<<34; cout is responsible for converting 34 into an appropriate format and then delegate the job of communicating data to its internal module which is a stream buffer and we can use cout.rdbbuf() to get a pointer to the internal module of stream buffer.
Anmol
but unable to write the code
There's such a thing as google!!!!!
Sachin
Consider a tunnel on a one-way road. During a particular day, nn cars numbered from 11 to nn entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds. A traffic enforcement camera is mounted at the tunnel entrance. Another traffic enforcement camera is mounted at the tunnel exit. Perfectly balanced. Thanks to the cameras, the order in which the cars entered and exited the tunnel is known. No two cars entered or exited at the same time. Traffic regulations prohibit overtaking inside the tunnel. If car ii overtakes any other car jj inside the tunnel, car ii must be fined. However, each car can be fined at most once. Formally, let's say that car ii definitely overtook car jj if car ii entered the tunnel later than car jj and exited the tunnel earlier than car jj. Then, car ii must be fined if and only if it definitely overtook at least one other car. Find the number of cars that must be fined. Input The first line contains a single integer nn (2≤n≤1052≤n≤105), denoting the number of cars. The second line contains nn integers a1,a2,…,ana1,a2,…,an (1≤ai≤n1≤ai≤n), denoting the ids of cars in order of entering the tunnel. All aiai are pairwise distinct. The third line contains nn integers b1,b2,…,bnb1,b2,…,bn (1≤bi≤n1≤bi≤n), denoting the ids of cars in order of exiting the tunnel. All bibi are pairwise distinct. Output Output the number of cars to be fined. Examples input Copy 5 3 5 2 1 4 4 3 2 5 1 output Copy 2 input Copy 7 5 2 3 6 7 1 4 2 3 6 7 1 4 5 output Copy 6 input Copy 2 1 2 1 2 output Copy 0 Note The first example is depicted below:  Car 22 definitely overtook car 55, while car 44 definitely overtook cars 11, 22, 33 and 55. Cars 22 and 44 must be fined. In the second example car 55 was definitely overtaken by all other cars. In the third example no car must be fined.
Sachin
Consider a tunnel on a one-way road. During a particular day, nn cars numbered from 11 to nn entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds. A traffic enforcement camera is mounted at the tunnel entrance. Another traffic enforcement camera is mounted at the tunnel exit. Perfectly balanced. Thanks to the cameras, the order in which the cars entered and exited the tunnel is known. No two cars entered or exited at the same time. Traffic regulations prohibit overtaking inside the tunnel. If car ii overtakes any other car jj inside the tunnel, car ii must be fined. However, each car can be fined at most once. Formally, let's say that car ii definitely overtook car jj if car ii entered the tunnel later than car jj and exited the tunnel earlier than car jj. Then, car ii must be fined if and only if it definitely overtook at least one other car. Find the number of cars that must be fined. Input The first line contains a single integer nn (2≤n≤1052≤n≤105), denoting the number of cars. The second line contains nn integers a1,a2,…,ana1,a2,…,an (1≤ai≤n1≤ai≤n), denoting the ids of cars in order of entering the tunnel. All aiai are pairwise distinct. The third line contains nn integers b1,b2,…,bnb1,b2,…,bn (1≤bi≤n1≤bi≤n), denoting the ids of cars in order of exiting the tunnel. All bibi are pairwise distinct. Output Output the number of cars to be fined. Examples input Copy 5 3 5 2 1 4 4 3 2 5 1 output Copy 2 input Copy 7 5 2 3 6 7 1 4 2 3 6 7 1 4 5 output Copy 6 input Copy 2 1 2 1 2 output Copy 0 Note The first example is depicted below:  Car 22 definitely overtook car 55, while car 44 definitely overtook cars 11, 22, 33 and 55. Cars 22 and 44 must be fined. In the second example car 55 was definitely overtaken by all other cars. In the third example no car must be fined.
How to approach this problem?
Anmol
Consider a tunnel on a one-way road. During a particular day, nn cars numbered from 11 to nn entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds. A traffic enforcement camera is mounted at the tunnel entrance. Another traffic enforcement camera is mounted at the tunnel exit. Perfectly balanced. Thanks to the cameras, the order in which the cars entered and exited the tunnel is known. No two cars entered or exited at the same time. Traffic regulations prohibit overtaking inside the tunnel. If car ii overtakes any other car jj inside the tunnel, car ii must be fined. However, each car can be fined at most once. Formally, let's say that car ii definitely overtook car jj if car ii entered the tunnel later than car jj and exited the tunnel earlier than car jj. Then, car ii must be fined if and only if it definitely overtook at least one other car. Find the number of cars that must be fined. Input The first line contains a single integer nn (2≤n≤1052≤n≤105), denoting the number of cars. The second line contains nn integers a1,a2,…,ana1,a2,…,an (1≤ai≤n1≤ai≤n), denoting the ids of cars in order of entering the tunnel. All aiai are pairwise distinct. The third line contains nn integers b1,b2,…,bnb1,b2,…,bn (1≤bi≤n1≤bi≤n), denoting the ids of cars in order of exiting the tunnel. All bibi are pairwise distinct. Output Output the number of cars to be fined. Examples input Copy 5 3 5 2 1 4 4 3 2 5 1 output Copy 2 input Copy 7 5 2 3 6 7 1 4 2 3 6 7 1 4 5 output Copy 6 input Copy 2 1 2 1 2 output Copy 0 Note The first example is depicted below:  Car 22 definitely overtook car 55, while car 44 definitely overtook cars 11, 22, 33 and 55. Cars 22 and 44 must be fined. In the second example car 55 was definitely overtaken by all other cars. In the third example no car must be fined.
Send the link to the problem instead
Anonymous
Consider a tunnel on a one-way road. During a particular day, nn cars numbered from 11 to nn entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds. A traffic enforcement camera is mounted at the tunnel entrance. Another traffic enforcement camera is mounted at the tunnel exit. Perfectly balanced. Thanks to the cameras, the order in which the cars entered and exited the tunnel is known. No two cars entered or exited at the same time. Traffic regulations prohibit overtaking inside the tunnel. If car ii overtakes any other car jj inside the tunnel, car ii must be fined. However, each car can be fined at most once. Formally, let's say that car ii definitely overtook car jj if car ii entered the tunnel later than car jj and exited the tunnel earlier than car jj. Then, car ii must be fined if and only if it definitely overtook at least one other car. Find the number of cars that must be fined. Input The first line contains a single integer nn (2≤n≤1052≤n≤105), denoting the number of cars. The second line contains nn integers a1,a2,…,ana1,a2,…,an (1≤ai≤n1≤ai≤n), denoting the ids of cars in order of entering the tunnel. All aiai are pairwise distinct. The third line contains nn integers b1,b2,…,bnb1,b2,…,bn (1≤bi≤n1≤bi≤n), denoting the ids of cars in order of exiting the tunnel. All bibi are pairwise distinct. Output Output the number of cars to be fined. Examples input Copy 5 3 5 2 1 4 4 3 2 5 1 output Copy 2 input Copy 7 5 2 3 6 7 1 4 2 3 6 7 1 4 5 output Copy 6 input Copy 2 1 2 1 2 output Copy 0 Note The first example is depicted below:  Car 22 definitely overtook car 55, while car 44 definitely overtook cars 11, 22, 33 and 55. Cars 22 and 44 must be fined. In the second example car 55 was definitely overtaken by all other cars. In the third example no car must be fined.
it's codeforces recent B
Jacobian
Consider a tunnel on a one-way road. During a particular day, nn cars numbered from 11 to nn entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds. A traffic enforcement camera is mounted at the tunnel entrance. Another traffic enforcement camera is mounted at the tunnel exit. Perfectly balanced. Thanks to the cameras, the order in which the cars entered and exited the tunnel is known. No two cars entered or exited at the same time. Traffic regulations prohibit overtaking inside the tunnel. If car ii overtakes any other car jj inside the tunnel, car ii must be fined. However, each car can be fined at most once. Formally, let's say that car ii definitely overtook car jj if car ii entered the tunnel later than car jj and exited the tunnel earlier than car jj. Then, car ii must be fined if and only if it definitely overtook at least one other car. Find the number of cars that must be fined. Input The first line contains a single integer nn (2≤n≤1052≤n≤105), denoting the number of cars. The second line contains nn integers a1,a2,…,ana1,a2,…,an (1≤ai≤n1≤ai≤n), denoting the ids of cars in order of entering the tunnel. All aiai are pairwise distinct. The third line contains nn integers b1,b2,…,bnb1,b2,…,bn (1≤bi≤n1≤bi≤n), denoting the ids of cars in order of exiting the tunnel. All bibi are pairwise distinct. Output Output the number of cars to be fined. Examples input Copy 5 3 5 2 1 4 4 3 2 5 1 output Copy 2 input Copy 7 5 2 3 6 7 1 4 2 3 6 7 1 4 5 output Copy 6 input Copy 2 1 2 1 2 output Copy 0 Note The first example is depicted below:  Car 22 definitely overtook car 55, while car 44 definitely overtook cars 11, 22, 33 and 55. Cars 22 and 44 must be fined. In the second example car 55 was definitely overtaken by all other cars. In the third example no car must be fined.
I solved it using inversion count by renumbering entry values and calculating inversions in exit using the new mapping
Khaleed
Ayy
rex
what is wrong in logic
David🇨🇺ElChino
what is wrong in logic
Does not get out of the for loop?
David🇨🇺ElChino
Because i--
rex
ohhh
klimi
Consider a tunnel on a one-way road. During a particular day, nn cars numbered from 11 to nn entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds. A traffic enforcement camera is mounted at the tunnel entrance. Another traffic enforcement camera is mounted at the tunnel exit. Perfectly balanced. Thanks to the cameras, the order in which the cars entered and exited the tunnel is known. No two cars entered or exited at the same time. Traffic regulations prohibit overtaking inside the tunnel. If car ii overtakes any other car jj inside the tunnel, car ii must be fined. However, each car can be fined at most once. Formally, let's say that car ii definitely overtook car jj if car ii entered the tunnel later than car jj and exited the tunnel earlier than car jj. Then, car ii must be fined if and only if it definitely overtook at least one other car. Find the number of cars that must be fined. Input The first line contains a single integer nn (2≤n≤1052≤n≤105), denoting the number of cars. The second line contains nn integers a1,a2,…,ana1,a2,…,an (1≤ai≤n1≤ai≤n), denoting the ids of cars in order of entering the tunnel. All aiai are pairwise distinct. The third line contains nn integers b1,b2,…,bnb1,b2,…,bn (1≤bi≤n1≤bi≤n), denoting the ids of cars in order of exiting the tunnel. All bibi are pairwise distinct. Output Output the number of cars to be fined. Examples input Copy 5 3 5 2 1 4 4 3 2 5 1 output Copy 2 input Copy 7 5 2 3 6 7 1 4 2 3 6 7 1 4 5 output Copy 6 input Copy 2 1 2 1 2 output Copy 0 Note The first example is depicted below:  Car 22 definitely overtook car 55, while car 44 definitely overtook cars 11, 22, 33 and 55. Cars 22 and 44 must be fined. In the second example car 55 was definitely overtaken by all other cars. In the third example no car must be fined.
And what is this?
klimi
Consider a tunnel on a one-way road. During a particular day, nn cars numbered from 11 to nn entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds. A traffic enforcement camera is mounted at the tunnel entrance. Another traffic enforcement camera is mounted at the tunnel exit. Perfectly balanced. Thanks to the cameras, the order in which the cars entered and exited the tunnel is known. No two cars entered or exited at the same time. Traffic regulations prohibit overtaking inside the tunnel. If car ii overtakes any other car jj inside the tunnel, car ii must be fined. However, each car can be fined at most once. Formally, let's say that car ii definitely overtook car jj if car ii entered the tunnel later than car jj and exited the tunnel earlier than car jj. Then, car ii must be fined if and only if it definitely overtook at least one other car. Find the number of cars that must be fined. Input The first line contains a single integer nn (2≤n≤1052≤n≤105), denoting the number of cars. The second line contains nn integers a1,a2,…,ana1,a2,…,an (1≤ai≤n1≤ai≤n), denoting the ids of cars in order of entering the tunnel. All aiai are pairwise distinct. The third line contains nn integers b1,b2,…,bnb1,b2,…,bn (1≤bi≤n1≤bi≤n), denoting the ids of cars in order of exiting the tunnel. All bibi are pairwise distinct. Output Output the number of cars to be fined. Examples input Copy 5 3 5 2 1 4 4 3 2 5 1 output Copy 2 input Copy 7 5 2 3 6 7 1 4 2 3 6 7 1 4 5 output Copy 6 input Copy 2 1 2 1 2 output Copy 0 Note The first example is depicted below:  Car 22 definitely overtook car 55, while car 44 definitely overtook cars 11, 22, 33 and 55. Cars 22 and 44 must be fined. In the second example car 55 was definitely overtaken by all other cars. In the third example no car must be fined.
/warns
I_Interface
And what is this?
This is the next warn.
klimi
i guess so
I_Interface
Consider a tunnel on a one-way road. During a particular day, nn cars numbered from 11 to nn entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds. A traffic enforcement camera is mounted at the tunnel entrance. Another traffic enforcement camera is mounted at the tunnel exit. Perfectly balanced. Thanks to the cameras, the order in which the cars entered and exited the tunnel is known. No two cars entered or exited at the same time. Traffic regulations prohibit overtaking inside the tunnel. If car ii overtakes any other car jj inside the tunnel, car ii must be fined. However, each car can be fined at most once. Formally, let's say that car ii definitely overtook car jj if car ii entered the tunnel later than car jj and exited the tunnel earlier than car jj. Then, car ii must be fined if and only if it definitely overtook at least one other car. Find the number of cars that must be fined. Input The first line contains a single integer nn (2≤n≤1052≤n≤105), denoting the number of cars. The second line contains nn integers a1,a2,…,ana1,a2,…,an (1≤ai≤n1≤ai≤n), denoting the ids of cars in order of entering the tunnel. All aiai are pairwise distinct. The third line contains nn integers b1,b2,…,bnb1,b2,…,bn (1≤bi≤n1≤bi≤n), denoting the ids of cars in order of exiting the tunnel. All bibi are pairwise distinct. Output Output the number of cars to be fined. Examples input Copy 5 3 5 2 1 4 4 3 2 5 1 output Copy 2 input Copy 7 5 2 3 6 7 1 4 2 3 6 7 1 4 5 output Copy 6 input Copy 2 1 2 1 2 output Copy 0 Note The first example is depicted below:  Car 22 definitely overtook car 55, while car 44 definitely overtook cars 11, 22, 33 and 55. Cars 22 and 44 must be fined. In the second example car 55 was definitely overtaken by all other cars. In the third example no car must be fined.
/warn read the rules
David🇨🇺ElChino
ohhh
I think you don't need the while loop, just with for you can print fact*=i
klimi
what is wrong in logic
@I_Interface what about this?
Anmol
what is wrong in logic
You are changing the value of i within the inner while loop
Anmol
So outer for loop becomes infinite loop
professor
how can I avoid this E0513 a value of type "LPVOID" cannot be assigned to an entity of type "char *"? #include <stdio.h> #include <windows.h> #define _CRT_SECURE_NO_WARNINGS #pragma warning(disable:4996) int main(int argc, char* argv[]) { char* a, * b, * c; HANDLE hHeap; if (argc < 2) { printf("Usage: heap argument\n"); exit(1); } hHeap = HeapCreate(HEAP_GENERATE_EXCEPTIONS, 5000, 9000); a = HeapAlloc(hHeap, HEAP_ZERO_MEMORY, 10); b = HeapAlloc(hHeap, HEAP_ZERO_MEMORY, 10); c = HeapAlloc(hHeap, HEAP_ZERO_MEMORY, 500); strcpy(c, argv[1]); /* !overflow */ HeapFree(hHeap,0,c); HeapFree(hHeap,0,b); HeapFree(hHeap,0,a); HeapDestroy(hHeap); }
Dima
just don’t use win32 api
Raz
just don’t use win32 api
If you need it, use it
Dima
Meh who would need it nowadays
Raz
Meh who would need it nowadays
Well.... You don't know Windows if you say something like that
Dima
I used to know and hopefully left it. nevermind, gone ot a bit.
I_Interface
I_Interface
@I_Interface what about this?
Left him for you. xd
klimi
Left him for you. xd
i dont need that
klimi
i am busy with my work
I_Interface
what is wrong in logic
/warn read the rules, no screen photo
Anonymous
read it.. thanks
Jacobian
Anonymous
Yes
Can you explain you solution?
Jacobian
First I mapped the entry sequence i.e. if the order was 2 1 3 4 then I mapped 2 to 1, 1 to 2, 3 to 3 and 4 to 4. Then using this new mapping I calculated number of inversions in the exit sequence. Eg. the exit sequence was 3 2 1 4, so according to the new mapping it becomes 3 1 2 4. Now calculate inversions in this and get answer.
Anonymous
#include <stdio.h> int main(int argc, char *argv[]){ int count; for(count = argc - 1; count > 0;count--){ printf(" %s ", argv[count]); } printf("\n"); return 0; }
Jacobian
If at any point during query you get number of inversions > 1 then consider it as 1 in final result
Anonymous
can anyone guess what this does
Anonymous
it should show the arguments to the program
Jacobian
This prints the terminal arguments given
Anonymous
yep
Anonymous
in reverse order
Anonymous
Anonymous
Anonymous
anyone here good with DS and algos?\
Anonymous
how can you store a string literal in a character array
Anonymous
lol
Anonymous
@Neko_cpp you say that because you dont know the answer
Dima
cool.
14•08
Remember that you are born to die .sometimes don't need warn ppl
Dima
Dima
#ot com'on
14•08
remember that I can warn in fact
😂😂 ok then come on #ot
Anonymous
Why ?
klimi
I think it explains itself
.
Hi
klimi
Hi
Hi
professor
does anyone here uses windbg?
Sameer
Hey i just want to know that i have to calculate xnor fibonacci series
Sameer
So my logic is that i have converted to binary
Sameer
Anyone can give me any idea regarding that??
Asad
well...
klimi
:)