Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя ajit

Автор ajit, история, 7 недель назад, По-английски

Hi,

While solving problem H of the recent Codeforces Div3 round (link), I came across the following issue (after hours of debugging):

In my solution, I had to clear up the segment tree after every test case, so I kept track of all the elements I interacted with in an STL container. The issue is that if I use std::set for keeping track of changed elements in the segment tree, I have no issues, but if I use std::vector, I get a weird runtime error on test 4. Here are my two solutions:

  • Accepted solution (using std::set variable called changed_elements in segtree structure) link
  • Runtime error solution (using std::vector variable called changed_elements in segtree structure) link

Can anyone tell me what's causing this runtime error?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +13
  • Проголосовать: не нравится

Автор ajit, история, 3 года назад, По-английски

We hope that you have enjoyed this round! Here is the sketch of solutions for the problems.

A. Array and Peaks

  • Problem Setter: ajit
  • Editorialist: ajit
Tutorial
Implementation in C++

B. AND Sequences

  • Problem Setter: ajit
  • Editorialist: ajit
Tutorial
Implementation in C++

C. Add One

Tutorial
Implementation in C++

D. GCD and MST

  • Problem Setter: ajit
  • Editorialist: ajit
Tutorial
Implementation in C++

E. Cost Equilibrium

Tutorial
Implementation in C++

F. Swapping Problem

Tutorial
Implementation1 in C++
Implementation2 in C++

Полный текст и комментарии »

  • Проголосовать: нравится
  • +153
  • Проголосовать: не нравится

Автор ajit, история, 5 лет назад, По-английски

Why does this happen frequently nowadays?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +42
  • Проголосовать: не нравится

Автор ajit, история, 5 лет назад, По-английски

In the recent codeforces global round 6 for the problem C DIVERSE MATRIX my code prints the transpose of the correct output matrix for the cases where r=1,c>1 and for r>1,c=1. But it gives me OK verdict for this wrong output format. This is my link to the submission.Is this a problem with the checker?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +16
  • Проголосовать: не нравится