Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

MikeMirzayanov's blog

By MikeMirzayanov, 2 weeks ago, In English

Hello, Codeforces!

I'm excited to invite you to participate in MaraTON Challenge 1, our first marathon in collaboration with the TON Foundation. It's great to see our partnership with TON thriving and moving forward.

Take part in the challenge →

The challenge is brought to you by TON blockchain engineers, some of whom are community members. Special thanks to SpyCheese for preparing the problem!

The competition will run for three weeks, starting on Dec/23/2024 16:35 (Moscow time). Get ready to dive deep into the technical details of the blockchain world — it's worth it.

Winners will receive amazing prizes:

  • 1st place: 8,000 USDT
  • 2nd place: 5,000 USDT
  • 3rd place: 3,000 USDT
  • 4th–10th places: 2,000 USDT each
  • 11th–20th places: 1,000 USDT each

Additionally, there will be bonus prizes for the leaders throughout the competition. Starting December 25th and continuing daily until January 13th at 13:35 (UTC), we will award bonus prizes to the top five leaders of the day:

  • 1st place: 250 USDT
  • 2nd place: 125 USDT
  • 3rd place: 75 USDT
  • 4th–5th places: 50 USDT each

Please note that these prizes will be distributed after full testing of all submissions made by 13:35 (UTC) on the respective day. The results are published here: https://mirror.codeforces.com/contest/2054/leadershipAwardsStandings

Join the competition — it's truly something new and exciting on Codeforces!

* All payments will be made to a TON wallet. All payouts (including those for daily leadership) will be issued after the final results are announced.
* In case of ties in the leaderboard, the participant who first achieved the score will rank higher for prize distribution.
* Please note that this is an individual competition. Collaboration, discussing ideas, or using shared code is prohibited. Please adhere to the rules regarding the use of third-party code.

UPD: Here is the link to the table with the current progress on rewards for daily leaders: https://mirror.codeforces.com/contest/2054/leadershipAwardsStandings

  • Vote: I like it
  • +185
  • Vote: I do not like it

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

sounds good)

»
2 weeks ago, # |
  Vote: I like it +17 Vote: I do not like it

will be rated???

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Exciting challenge ahead! Good luck to all participants. I hope the problems will be enjoyable and fun.

»
2 weeks ago, # |
  Vote: I like it -21 Vote: I do not like it

where is magic

»
2 weeks ago, # |
  Vote: I like it -41 Vote: I do not like it

gpt o3 will win. all top 20 prizes.

»
2 weeks ago, # |
  Vote: I like it +1 Vote: I do not like it

Number of problems and score distribution?

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

whats a marathon

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

i want to win a tshirt

»
13 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Am I allowed to take part in other contests while being registered for this one?

»
13 days ago, # |
  Vote: I like it 0 Vote: I do not like it

rated?

»
13 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Woohoo, I liked the button part!

»
13 days ago, # |
  Vote: I like it +41 Vote: I do not like it

is there a CP contest or blockchain?

»
13 days ago, # |
  Vote: I like it +3 Vote: I do not like it

Bangali can relate the name of this contest LOL

»
13 days ago, # |
  Vote: I like it +3 Vote: I do not like it

Although I might certainly never be close to winning one, can you consider issuing the prizes in some other stablecoin?

  • »
    »
    12 days ago, # ^ |
      Vote: I like it -67 Vote: I do not like it

    USDT is fine. Consider not living in a totalitarian shithole called "EU".

    • »
      »
      »
      12 days ago, # ^ |
        Vote: I like it -7 Vote: I do not like it

      Ok

    • »
      »
      »
      3 days ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      Accurate name and title

»
12 days ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

What kind of problems can we expect to see here? Any examples??

»
12 days ago, # |
  Vote: I like it 0 Vote: I do not like it

how to reach tourist?

»
12 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Why are the details of this contest secret?

»
12 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Do we have to submit the problems daily or can we also enter the contest a few hours after it begins on the first day?

»
11 days ago, # |
  Vote: I like it 0 Vote: I do not like it

would it be rated ?

»
11 days ago, # |
  Vote: I like it +13 Vote: I do not like it

Do we need to learn some blockchain algorithms (like cryptography e.g.) in order to have good performance in the contest? (or only cp algorithms is enough ?)

»
11 days ago, # |
  Vote: I like it +19 Vote: I do not like it

Also, will there be pretest and final test like other ICPC challenges?

»
11 days ago, # |
  Vote: I like it -13 Vote: I do not like it

Will this round be accessible for a newbie?

»
11 days ago, # |
  Vote: I like it 0 Vote: I do not like it

will it be rated? can i participate in other contests while participating in this for 21 days?

»
11 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Is this rated ??

»
11 days ago, # |
  Vote: I like it +10 Vote: I do not like it

This contest have a system testing, then leaders' prizes are based on provisional standings?

»
11 days ago, # |
  Vote: I like it 0 Vote: I do not like it

It's C++, not funC

»
11 days ago, # |
  Vote: I like it 0 Vote: I do not like it

The answer is in the question..awa

»
11 days ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Could you share some background about this contest, or at least what should I know? I would like to know if CPers are a good fit for this problem, or is this contest not for me?
I only have math sword and algorithm gun.

»
11 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Is there any submission number limit for this contest?

  • »
    »
    11 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Sorry, I mean, how many times can I submit at maximum during the contest.

»
11 days ago, # |
  Vote: I like it -10 Vote: I do not like it

"This set will consist of blocks from the TON mainnet that will be generated after the end of the contest." Kinda sus

»
11 days ago, # |
  Vote: I like it +29 Vote: I do not like it

I have found an easter egg in examples:) Thanks for 20 ton!

  • »
    »
    10 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    oh darn I should've thought of Caesar cipher originally when I decoded that b64 string a few hours ago LOL. Good for you though!

  • »
    »
    10 days ago, # ^ |
      Vote: I like it +18 Vote: I do not like it

    Bro i just realized what you talking about. I though all of the example base64 can only converted to BufferSlice, but base64 on lz4 example can be decoded to regular string, and when decode it using caesar cipher algorithm with shift 3, its become 24 random words. And its same length with TON Wallet recovery phrase.

»
10 days ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

Tshirt?

»
10 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Rated or Unrated ?

»
10 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Will there be only 1 task for 3 weeks?

»
10 days ago, # |
  Vote: I like it -29 Vote: I do not like it

what will be the answer for n=32; in problem (a) i think to slove this problem like that: 32---(8,8)-(2,2)-(2,2). my answer is 6

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

good

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Merry Christmas!

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

is it beginner friendly?

»
8 days ago, # |
  Vote: I like it +13 Vote: I do not like it

Here is the link to the table with the current progress on rewards for daily leaders: https://mirror.codeforces.com/contest/2054/leadershipAwardsStandings

  • »
    »
    7 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    21 days in total. Do you think that after a week, we will still get better and better results from the same people?

»
7 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Anyone able to run solution locally on apple silicon?

I am getting "Undefined symbols for architecture arm64:"

»
7 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Hi! This seems very interesting. I have two questions:

1- Is there any place where I can find some sort of reference for the td library they use in the example? It's C++, but it's their C++. It feels kind of Rusty. Maybe I'm just not familiar enough with actual production C++ code.

2- While reading about the serialization of the BoC (here) I didn't understand the step of, and I quote:

For data with incomplete 4-bit groups, 1 bit is added to the end of the sequence. This means it denotes the end bit of the group and is used to determine the true size of incomplete groups.

that's after the descriptors are calculated. I don't understand how it works and how it can be used in reverse.

»
7 days ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Did someone encounter clang++: error: linker command failed with exit code 1120 (use -v to see invocation) for some code that can run locally with gcc and clang? For local testing I am using the docker image.

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Is it rated ?????

»
5 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Hey, could you please take a look a this PR: https://github.com/ton-blockchain/ton/pull/746

In short — codegen produces code like cs.advance_ext(0x20003) to advance 2 refs and 3 bits. However advance_ext implementation treats them as 2 bits and 3 refs and therefore fails to advance for refs. The implementation is also not aligned with fetch_subslice_ext and have_ext logic.

Why is this important:

  1. codegen unpack uses fetch which is fetch_to(get_size())
  2. TLB::get_size is set to get_size_by_skip
  3. get_size_by_skip calls skip produced by codegen
  4. skip contains calls to CellSlice::advance_ext
  5. Therefore unpack methods are broken

You can spot the issue by looking at InMsg codegen:

bool InMsg::skip(vm::CellSlice& cs) const {
  // ...
  case msg_import_fin:
    return cs.advance_ext(0x20003)  // this will try to advance 2 bits and 3 refs
        && t_Grams.skip(cs);
  // ...
}

// validate_skip is correct - just an example to compare to. You can see here it advances by 3 bits and 2 refs
bool InMsg::validate_skip(int* ops, vm::CellSlice& cs, bool weak) const {
  // ...
  case msg_import_fin:
    return cs.advance(3)
        && t_MsgEnvelope.validate_skip_ref(ops, cs, weak)
        && t_Transaction.validate_skip_ref(ops, cs, weak)
        && t_Grams.validate_skip(ops, cs, weak);
  // ...
}
  • »
    »
    4 days ago, # ^ |
    Rev. 4   Vote: I like it 0 Vote: I do not like it

    Probably got something close:

    #7  0x00007ffff7c8c4b1 in std::terminate() () from ./libton_crypto_lib.so
    #8  0x00007ffff7c8d033 in __cxa_throw () from ./libton_crypto_lib.so
    #9  0x00007ffff7981713 in vm::load_cell_slice_impl(td::Ref<vm::Cell>, bool*) () from ./libton_crypto_lib.so
    #10 0x00007ffff7981a00 in vm::load_cell_slice(td::Ref<vm::Cell> const&) () from ./libton_crypto_lib.so
    #11 0x00007ffff78a14e4 in block::gen::BlockInfo::cell_unpack(td::Ref<vm::Cell>, block::gen::BlockInfo::Record&) const () from ./libton_crypto_lib.so
    #12 0x0000555555558c7e in compress (data=...) at solution.cpp:37
    #13 0x000055555555940d in solve (in=...) at solution.cpp:75
    #14 0x0000555555559627 in main (argc=2, argv=0x7fffffffdc98) at solution.cpp:86

    I am quite sure, that std::terminate should not be called in any kind of parsing.

    Got this with following code:

    block::gen::BlockInfo::Record state_update_rec;
    block::gen::BlockInfo().cell_unpack(block_rec.state_update, state_update_rec);

    P.S. understood, why it doesn't work, but it still shouldn't be calling std::terminate

»
5 days ago, # |
Rev. 4   Vote: I like it 0 Vote: I do not like it

It would be useful to have build with debug symbols too!

Not cool:

(gdb) p *root.ptr
$7 = <incomplete type>

And can't go into std_boc_deserialize std_boc_serialize. Why not?)

UPD. Found CellSlice in another .zip, but still, debug symbols are pretty useful!