rizzgod_tourist's blog

By rizzgod_tourist, history, 4 months ago, In English

Hello Codeforces community,

I'm reaching out for help with a Rust programming issue that's been frustrating me for a while. As a beginner in Rust, I'm struggling to understand how to read complex inputs, especially when it comes to competitive programming.

I've been trying to learn Rust, but I'm finding it challenging to grasp the concept of input/output handling. I've watched YouTube tutorials, but they only cover basic examples like "Hello, World!" or reading simple integers , also i have tried exploring some of the udemy courses but they are teaching all the complex stuff but they are not telling how to read input . However, when it comes to more complex inputs, such as reading multiple test cases with varying input formats, I'm lost.

I've tried to convert my C++ code to Rust using AI-powered tools like Blackbox AI and ChatGPT, but the generated code doesn't work as expected. I've also used C++ to Rust converters, but the resulting code doesn't produce any output.

Here's my C++ code that I'm trying to convert to Rust:

c++ Code

The AI-generated Rust code is:

rust Code

However, this code is giving me an "idleness limit" error, which I've never seen before in C++ or Java.

If someone could provide guidance on how to read complex inputs in Rust or share a working code for this problem without using templates, I would greatly appreciate it. I'm eager to learn and understand the underlying concepts, rather than just copying and pasting code.I don't want to use templates , first i want to write the raw code i don't care about writing some more line of code but i want to know everything from scratch also when i will become somewhat decent then i will write my own template i don't want to blindly follow some template and simply say that reading input and output is complicated in rust.

I've searched for Rust submissions for this problem (https://codeforces.net/contest/1876/problem/A), but out of nearly 7,000 submissions, I only found 6-7 in Rust, and they were all using templates for reading inputs.

Please help me overcome this hurdle, and I'll be grateful for any resources or explanations that can aid my learning journey in Rust.

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

It would much easier for people to help you if you format your code a little better. You can read about formatting here.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by rizzgod_tourist (previous revision, new revision, compare).

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by rizzgod_tourist (previous revision, new revision, compare).