Anonymous
Error:
Anonymous
Wrong Answer. !!!Wrong Answer Possibly your code doesn't work correctly for multiple test-cases (TCs). The first test case where your code failed: Input: 84 86 77 15 93 35 86 92 49 21 62 27 90 59 63 26 40 26 72 36 11 68 67 29 82 30 62 23 67 35 29 2 22 58 69 67 93 56 11 42 29 73 21 19 84 37 98 24 15 70 13 26 91 80 56 73 62 70 96 81 5 25 84 27 36 5 46 29 13 57 24 95 82 45 14 67 34 64 43 50 87 8 76 78 88 Its Correct output is: 4278 And Your Code's output is: 2412
Anonymous
What is the actual problem and how to fix it?
Anonymous
What is the actual problem and how to fix it?
Write code that solves the problem
Anonymous
Write code that solves the problem
I'm facing problem sir. If you will guide, then I can give a try.
klimi
Looks easy
Artöm
Of which size?
Anonymous
with size
Artöm
n is not a constant exoression and is uninitialized
Artöm
Btw you dont even need array in this case
Anonymous
Btw you dont even need array in this case
in the question itself, it's mentioned to take array as an input
Artöm
Which doesnt mean you actually need to create it
Artöm
Array here is number sequence, not array in prigramming terms
Anonymous
/warn no homeworks here
Anonymous
https://img.kingdev.nl/devenv_2019-11-04_15-50-22.png
Anonymous
Is there a better way of doing this?, Blocks are made using a for (int x = 0; x < WORLD_WIDTH; x++) for (int y = 0; y < WORLD_HEIGHT; y++) for (int z = 0; z < WORLD_DEPTH; z++) {
Anonymous
The current blockAt code realy slows down my game by a lot, I wonder if any math can be done with the XYZ to get the index of it in the blocks vector.
Anonymous
How would i do that?
Javi
How would i do that?
The positions are just the coordinates in a 3d matrix. Order the positions and you won't have to search
数学の恋人
hey guys, I have a question, Say I have a function which takes file as an argument, (file can be **argv contents or stdin), my main problem is that I don't know how to pass stdin as argument to that function
01000001011011010100000101101110
yes
pass the value from main() it must work
数学の恋人
pass the value from main() it must work
that's what I'm doing
01000001011011010100000101101110
数学の恋人
I pass the file name like if (argc < 2) { someFunc(stdin); } else { for (int i = 1; i < argc; i++) { someFunc(argv[i]); } }
数学の恋人
01000001011011010100000101101110
why dont you ask for values in if itself before calling the function?
01000001011011010100000101101110
if (argc < 2) { int bla; std::cin>>bla someFunc(bla); } else { for (int i = 1; i < argc; i++) { someFunc(argv[i]); } }
Anonymous
the code is wrong
Anonymous
it lacks ) to the end of someFunc
数学の恋人
oh sorry
数学の恋人
I pass the file name like if (argc < 2) { someFunc(stdin); } else { for (int i = 1; i < argc; i++) { someFunc(argv[i]); } }
files := os.Args[1:] var source string if len(files) == 0 { someFunc(os.Stdin) source = "Stdin" } else { for _, arg := range files { source = arg v, err := os.Open(arg) if err != nil { fmt.Fprintf(os.Stderr, "someProgram: %v\n", err) continue } someFunc(v) v.Close() } }
X3eRo0
Is fopen unsafe?
数学の恋人
Ann0nB0t
Photo from Pratik
Ann0nB0t
This program goes in infinite loop
Ann0nB0t
What's wrong in it?
Anonymous
What's wrong in it?
You are setting i to 0 in inner loop
Anonymous
Photo from Pratik
And don't use this
Anonymous
Borland C is not good
Ann0nB0t
It's turbo c
Anonymous
It's turbo c
It's bad
Ann0nB0t
This which one should i use?
Francisco
Anonymous
I_Interface
Ann0nB0t
Anonymous
Windows 10
Then use Visual Studio Community
Ann0nB0t
Ok
Francisco
Windows 10
MSVC is the best one
Ann0nB0t
Photo from Pratik
By using For (i=1;i<3;i++) Should it works....
I_Interface
By using For (i=1;i<3;i++) Should it works....
U are using one variable for out and internal loop, what the fuck ?
I_Interface
I'm begginer plzzz can uexplain me
I don't have time for explaination, read books, watch videos.
Ann0nB0t
Ok
X3eRo0
no
Vscode is complaining I had to disable the warning to compile
X3eRo0
It also says fopen is unsafe use fopen_s
Anonymous
What's wrong in it?
Don't use turbo c😂😂😂
Anonymous
It runs into error most of the time
Artöm
!report
klimi
!report
thanks
Mat
By using For (i=1;i<3;i++) Should it works....
Use different variables for different loops
Kharon
/report
Anonymous
How do I get this solve.
Anonymous
/report
Anonymous
Anonymous
Pls explain
Anonymous
How do I get this solve.
You're missing make
Anonymous
Google it up
Anonymous
Am building a program in Apache netbean and this pop the comes up when ever I try to build my program
correctmaninwrongplace
/warn