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

Автор Safrout, 9 лет назад, По-английски

Is the usage of multiple threads in Java allowed in the ICPC or no??

added after edit {

I know it won't differ in time but there is a powerful feature in Java that I want to know if I can use it or no.

The feature is the ability of changing the size of the memory stack for recursion.

I can set it for threads by this constructor

new Thread(null, new Runnable() {
    public void run() {
        new Solution().run();
    }
}, "1", 1 << 23).start();

Here the 1 << 23 is the new size for the memory Stack.

The whole solution will be written in the Solution().run() method.

So I don't need to do multiple threads and avoid time. I only need to make one single thread

}

Is this possible in the ICPC World Finals or not ?

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

»
9 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
  • »
    »
    9 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    I can't find something about it there.

    But I have doubts about it with some people.

»
9 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Serious test engines measure cpu time, but not astronomical time. Your total running time will be sum of cpu times for all threads plus other costs for using threads. So threads will be not as useful as you planned.

  • »
    »
    9 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    I know it's not useful in time.

    But in Java it gives me other powerful tools by just making one thread.

    I don't care about the time I only care about the allowability of using it.

    • »
      »
      »
      9 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Can you, please, explain for me and other readers, what features is it?

      • »
        »
        »
        »
        9 лет назад, # ^ |
          Проголосовать: нравится +12 Проголосовать: не нравится

        The feature is changing the size of the memory stack for recursion.

        You can use this in java in your main method

        new Thread(null, new Runnable() {
        public void run() {
        new Solution().run();
        }
        }, "1", 1 << 23).start();
        

        the 1 << 23 is the new size of the memory stack.

        the whole solution will be written in the Solution().run() method.

        So I don't need to do multiple threads and avoid time. I only need to make one single thread.

      • »
        »
        »
        »
        9 лет назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        But I didn't get it.

        Is it allowed in the ICPC finals or not ?

        • »
          »
          »
          »
          »
          9 лет назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится

          I don't know about ICPC final, but as I remember we used it in semifinals and quarterfinals (NEERC).