I_love_tigersugar's blog

By I_love_tigersugar, history, 3 years ago, In English

Today I tried to create a new problem on Polygon. After committing changes, I would like to create a problem package, but the following message appears:

PackageException: Failed on verification of the first test: Can't compile file: could not create dummy IR bfd: Memory exhausted collect2.exe: error: ld returned 1 exit status

Has anyone encountered the same issue? Could you admins help me on this?

Have a good day everyone!

Full text and comments »

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

By I_love_tigersugar, 4 years ago, In English

1255A - Changing Volume

Author: UncleGrandpa. Prepared by UncleGrandpa

Tutorial

1255B - Fridge Lockers

Author: I_love_tigersugar ft. MikeMirzayanov. Prepared by UncleGrandpa

Tutorial

1255C - League of Leesins

Author: MikeMirzayanov. Prepared by UncleGrandpa

Tutorial

1254A - Feeding Chicken

Author: I_love_tigersugar. Prepared by I_love_tigersugar

Tutorial
Source code

1254B1 - Send Boxes to Alice (Easy Version)

Author: MofK. Prepared by UncleGrandpa

Tutorial
Source code

1254B2 - Send Boxes to Alice (Hard Version)

Author: MofK. Prepared by MofK and UncleGrandpa

Tutorial
Source code

1254C - Point Ordering

Author: ngkan. Prepared by ngkan

Tutorial
Source code

1254D - Tree Queries

Author: I_love_tigersugar Prepared by I_love_tigersugar

Tutorial
Source code

1254E - Send Tree to Charlie

Author: MofK Prepared by: MofK

Tutorial
Source code

Full text and comments »

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

By I_love_tigersugar, history, 5 years ago, In English

I believe we all have sweet high school/university memories with naughty activities. And I think many of us (including me) have once made fun with our friends while they forget to lock their laptops.

Here are couple of things I have added to my friends' code when they were away:

#define cout   cerr

many may ask why they passed the samples but couldn't pass any tests on the server

#define printf(...)   fprintf(stderr, __VA_ARGS__)

same as above, but for anti-fan of cin/cout

#define if   if(true); else if

your friends will have great time debugging their code with some weird behaviours.

#define freopen(...) void()

extremely helpful when your judging system use input/output via files

int a[0100100];

just add a small zero, but the whole world can change.

What else do you do? Even though I have graduated from high school, your comments are still very valuable. And I honestly hope your friendships stay stronger after these things :)

Full text and comments »

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

By I_love_tigersugar, history, 5 years ago, In English

Hi Codeforces,

I see the next Div.1 round takes place on March 30th, 16:35 (UTC). I will be on flight to the World Finals at that time, and I believe some of World Finalists would be in the same situation (WF starts on March 31st).

I think it would be better if the round takes place one day earlier. I rarely see Div.1 rounds in March (the most recent was held at "unusual" time, the one before was unrated). I would like this luxurious opportunity to enjoy and train :)

Please tell me what you think.

Full text and comments »

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

By I_love_tigersugar, history, 7 years ago, In English

Do you feel the breath of the coming women's day? It's time for men to share lovely code to women :) More surprisingly, today is the 19th birthday of DemiGuo (Facebook tells me that) :D

Happy women's day! Wishing all angels in the world being brighty stars and sweet roses, who inspires man to have lovely code

Full text and comments »

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

By I_love_tigersugar, history, 7 years ago, In English

Hello Codeforces community!

Right now, my team are training hard for ACM-ICPC World Finals 2017. It's the last World Final in my life!

However, while seeing various contests at Codeforces::Gym, I am really confused of which contests are appropriate to prepare for World Finals. Except past WF (there are few such contests), others seem to be unsuitable (regional contests, except NEERC, might be easier, while Petrozavosk Training rounds turn out to be deadly). Which kinds of contest do you use for training?

Beside that, I would like to know if there are training contests. I highly appreciate Codeforces weekly Training or NAIPC. I understand that doing virtual contests are adequate, but such contests attract more teams, therefore they reflect accurately where we are in the world!

Thank you very much and see you in World Finals!

Full text and comments »

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

By I_love_tigersugar, history, 7 years ago, In English

Hello Codeforces community,

I am lookding for an online judge system for training for Vietnam National Olympiad in Informatics. The system should satisfy the following conditions:

  • It supports adding problems manually.

  • It can judge the submissions according to OI style (The number of points a submission gains is directly proportional to the number of test cases it passes).

SPOJ used to be the best choice for a long period of time. However, its limitation in the number of test cases (at most 16) makes it no longer be a perfect choice. Codeforces, as far as I know, despite allowing local training, does not provide the OI judging service.

Can you give me any advice on where I should host the judging service? Writing my own server, of course, is not my expected answer.

Thank you :D

P/s: Today is Jan 11th now. Why the Christmas theme still appears on Codeforces?

Full text and comments »

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

By I_love_tigersugar, history, 8 years ago, In English

Hi everyone,

I am trying to solve problems by JAVA so I want to use Chelper. Here is what I have done:

  1. Install IntelliJ IDEA 2016.2.4

  2. Install CHelper plugin

  3. Create an empty project named "Competitive programming"

  4. Change some project settings like the image below:

However, it does not work. When I click on "New task", it says "defaultDirectory should be under source and in non-default package."

Could anyone show me the way to setup CHelper? I am new to Java and IntelliJ so many things may be unclear with me.

Thank you very much for your help

Full text and comments »

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

By I_love_tigersugar, history, 8 years ago, In English

UPDATE:

Official result of IOI 2016 has been published here: http://stats.ioinformatics.org/results/2016

The closing ceremony of IOI will start on 16:00 MSK. Online stream is available here: https://www.youtube.com/watch?v=BAkcby2xEwQ


Hey guys!

Hello all IOI 2016 participants!

IOI 2016 has eventually started. It's my big sadness that I can not take part in IOI this year. I am too old to do that :((

How is everything now in Kazan? I guess that Russian girls are all cute and beautiful, right? Can you share with me your feelings, funny stories and photos inside this post? I really want to hear from you, even when I feel jealous with you.

Anyway, congratulations for being here. You are all the best. Wish you sweet, amazing and memorable moments at IOI. Best luck in the contest and hope you will get high ratings. (just kidding :D)

Full text and comments »

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

By I_love_tigersugar, history, 8 years ago, In English

The easy problem in SRM 685 is the N-th time I failed because of using __builtin_popcount instead of __builtin_popcountll. As a result, a new line has been added to my template code:

#define __builtin_popcount __builtin_popcountll

Btw, does anyone have an idea why C++ doesn't merge the 2 above functions into one to avoid such silly mistakes?

Full text and comments »

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

By I_love_tigersugar, history, 8 years ago, In English

Happy International Women's day to all female members on Codeforces, especially Delinur and DemiGuo. Wish you all beautiful, successful and receive many flowers from guys today :D

P/s: How many girls are there on Codeforces?

Full text and comments »

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

By I_love_tigersugar, history, 8 years ago, In English

Where is the announcement blog for Codeforces Round #345? Why the authors are still silent? Do they want to keep it secret?

Full text and comments »

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

By I_love_tigersugar, 9 years ago, In English

Hi everyone!

Today, I found some problems while trying to print a double values in C++. Below is my code:

#include<bits/stdc++.h>
using namespace std;
int main(void) {
    double x=1.0/3000;
    printf("%.7lf\n",x);
    return 0;
}

When I compile this code using command mingw32-g++.exe -O2 -Wl,--stack=268435456 -DSKY, I saw 0.0003333. However, after changed to mingw32-g++.exe -O2 -std=c++11 -Wl,--stack=268435456 -DSKY (include C++11), I saw 0.0000000.

I uss Windows 8 and my g++ version is:

C:\Program Files (x86)\CodeBlocks\MinGW\bin>"mingw32-g++.exe" --version
mingw32-g++.exe (tdm-1) 4.7.1
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Has anyone ever met this problem? What is the solution to avoid this?

I'm looking forward to your answers. Thank you :D

Full text and comments »

By I_love_tigersugar, 9 years ago, In English

The April Fools' day (April 1st) is coming shortly. Traditionally, every year on this day there is a contest called April Fools' day contest. However, it seems that no such contests this year.

April Fools' day contest is a special interesting contest, and held only one per year. So it will be a great pity if it isn't held this year.

Full text and comments »

By I_love_tigersugar, 9 years ago, In English

Given a non self-intersect polygon and a line. How can I calculate the total length of parts of line which are inside the polygon? I need an O(NlogN) or faster algorithm, where N is the number of vertices of polygon.

For example, below is the polygon ABCDEFGH.

With line y = 0, no parts inside the polygon.

With line y = 2, the parts inside the polygon are IJ and KL, and the total length is 2.5.

With line y = 3, the part inside the polygon is BC, which has length 1,

Image and video hosting by TinyPic

I'm looking for your answers. Thanks for your help.

Full text and comments »

By I_love_tigersugar, 9 years ago, In English

The rockethon 2015 T-shirt is the 7th T-shirt I have won since I joined competitive programming. I'm very happy about them, as they are very nice and help me save money a lot.

However, I can't go out with shirts only. I also need some jeans. :( I can't find any contests arwarding jeans. Why don't contest organizers arward jeans instead of T-shirts? Wearing rockethon T-shirt with rockethon jean will be very interesting! :)

Full text and comments »

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

By I_love_tigersugar, 9 years ago, In English

The new year has already begun in some countries (New Zealand, Australia,...) Do you feel the breathe of a coming new year?

Wishing all of you good health, great success, happiness. Hoping there will be a lot of interesting contests, and many red coders next year.

HAPPY NEW YEAR 2015!!!

Image and video hosting by TinyPic

Full text and comments »

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

By I_love_tigersugar, 9 years ago, In English

Do you remember? One year ago, Codeforces Round #210 was delayed 1.5 hours because of our Codeforces admin MikeMirzayanov's daughter's birthday! Now she is 3 years old. This year, no contests seem to be moved, but I think a big party will be held.

Happy birthday to the little princess. Wishing her everything best in the world!

Image Hosted At MyspaceGens

Full text and comments »

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

By I_love_tigersugar, 9 years ago, In English

In number theory, we always write a ≡ b (mod p) means that the reminder of division of a by p and the reminder of b by p are the same. Today, I have a question about this definition.

1. Same reminder of integers:

If , a ≡ b (mod p) means or . It's quite easy to see that.

2. Same reminder of rational numbers:

We also write , for example: . What do they mean?

The above definition is obviously wrong, since . But with the modular multiplicative inverse, can be written as a * b - 1 ≡ r (mod p). So, in this case, I think the definition should be: means: For every pair of integers (A, B) satisfies , we always have . Note that so we can use the definition for integers.

3. Same reminder of irrational numbers:

In the editorial of problem 446C - DZY Loves Fibonacci Numbers, the authors wrote:

Fn ≡ 276601605(691504013n - 308495997n) (mod 109 + 9)

The correctness of the last equation can be proved easily. However, to get the final equation, we need some transform like: .

My question is, how can we define equations a ≡ b (mod p), when a or b is irretional number like that, and why the above transform is correct.

I'm looking forward to hearing your responses. Thank you for your help!

P/s: I know, this blog may have something difficult to be understood, but please do not vote down it. I have thought a lot about this problem, but I can't find the answer.

Full text and comments »

By I_love_tigersugar, 9 years ago, In English

Hello Codeforces community!

Today, I found a new function on Codeforces, it looks like the file comparing. As you can see, when you are viewing a submission details, a new button "Compare" appears:

Image Hosted At MyspaceGens If you click the button, you can choose another submission, and Codeforces will show you the difference between the current submissions and the one you chose:

Image Hosted At MyspaceGens

I think this function is useful. For example, you solved a problem long time ago, and now you forgot the solution! You look at your accepted code to see how to solve it. You have made two submissions, one correct, one incorrect. With "Compare" funcion, you can easily find the mistakes in your incorrect submission. Therefore, you can determine the reason of your mistakes (a small bug in coding, or a tricky test case).

I hope my discovery will have you a lot! Thank you for reading it.

Full text and comments »

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

By I_love_tigersugar, 10 years ago, In English

Tomorrow, the next SRM will be held at 07:00 EDT. Don't miss!

Have a nice SRM. Good luck :D

Full text and comments »

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

By I_love_tigersugar, 10 years ago, In English

The Round 2 of TopCoder Open 2014 Algorithm ended a few months ago. Are there any announcements about T-shirts? My best rank on Round 2 was 82, can I win a T-shirt?

Full text and comments »

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

By I_love_tigersugar, 10 years ago, In English

Congratulations! worse has become the first person on Codeforces with negative rating!!!

I wonder, how many CF rounds does tourist need to have rating lower than worse :D

Full text and comments »

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

By I_love_tigersugar, 10 years ago, In English

Tommorow, the SRM 632 will be held at 7:00 EDT. This is the last chance for you to use the web arena and be able to win TC prizes (a trip to TCO14 or a T-shirt!). Don't forget to use the web arena and "test your luck".

I wish you would be "lucky enough" to win prizes!he

Happy coding.

P/s: The SRM schedule of this year is fully updated.

Full text and comments »

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

By I_love_tigersugar, 10 years ago, In English

Tomorrow, the last SRM in August will be held at 12:00 EDT. It's sponsored by HP — as SRM 630. Don't miss it!

Enjoy your SRM, have fun and get high rating!

UPD: Contest ended. Let's discuss problems here!

Full text and comments »

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