aslf010990's blog

By aslf010990, history, 7 years ago, In English

Hello to all, the world final of acm icpc 2018 is very near, and as each year grows more expectations of knowing which team will be the great winner, here is my prediction of those who will occupy the podium this year. (my prediction is based on the average classification of each team)

    • Peking University (3052)
    • Moscow State University (2875)
    • Seoul National University (2850.33)
    • University of Warsaw (2845)
    • St. Petersburg ITMO University (2714)
    • Moscow Institute of Physics & Technology (2678)
    • University of Tokyo (2552)
    • University of New South Wales (2545)
    • Tsinghua University (2541.33)
    • Fudan University (2534.66)
    • St. Petersburg State University (2475)
    • KAIST (2469.33)

Full text and comments »

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

By aslf010990, history, 8 years ago, In English

Hello to the whole community, I am trying to learn DP, I am a little confused and I ask some tips to learn this technique, greetings

Full text and comments »

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

By aslf010990, 10 years ago, In English

hi all, i am learning priority queues, you can indicate exercises where applied this data struct? thank you.

Full text and comments »

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

By aslf010990, 10 years ago, In English

I was checking the score board of the Google Code Jam Round 1A, I not find to tourist , Does not he not participate?

Full text and comments »

  • Vote: I like it
  • -16
  • Vote: I do not like it

By aslf010990, 10 years ago, In English

Hello everyone, I am trying to solve this problem, I've tried 4 times and am getting wrong answer , I ask you to please guide me a little to solve the probelema , this is my code , greetings and thanks .

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class Main {
    static PrintWriter out = new PrintWriter(System.out);
    static boolean ok,ok2;
    public static class Node
    {
        public char c;
        public Node next,ant;
        public Node(char c)
        {
            this.c=c;
            this.next=null;
        }
    }
    public static class Lista
    {
        public Node first,last;
        public Lista()  //constructor
        {
            this.first=this.last=null;
        }
        public Lista InsertBegin(Node nuevo)
        {
            nuevo.next=first;
            first=nuevo;
            if(!ok)
                last=first;
            ok=true;
            return this;
        }
        public Lista InsertEnd(Node nuevo)
        {
            if(!ok2)
            {
                nuevo.next=first;
                first=nuevo;
                last=first;
                ok=true;
            }
            else
            {
                last.next=nuevo;
                last=nuevo;
            }
            ok2=true;
            return this;
        }
        public Lista Visualize()
        {
            for(Node i=first;i!=null;i=i.next)
                out.write(i.c+"");
            out.write("\n");
            return this;
        }
    }
    public static void main(String[] args) throws IOException {
        BufferedReader cin=new BufferedReader(new InputStreamReader(System.in));
        String s="";
        while((s=cin.readLine())!=null)
        {
            char arre[]=s.toCharArray();
            Lista lis=new Lista();
            ok=ok2=false;
            int t=arre.length,aux=0;
            for(int i=0;i<t;i++)
            {
                if(arre[i]=='[')
                {
                    aux=i+1;
                    while(aux<t && arre[aux]!='[' && arre[aux]!=']')
                        aux++;
                    for(int j=aux-1;j>i;j--)
                        lis.InsertBegin(new Node(arre[j]));
                    i=aux-1;
                }
                else if(arre[i]!=']')
                    lis.InsertEnd(new Node(arre[i]));
            }
            lis.Visualize();
        }
        out.flush();
    }
}

Full text and comments »

  • Vote: I like it
  • -1
  • Vote: I do not like it

By aslf010990, 10 years ago, In English

Hello, I have a question as to calculate the term x of the fibonacci suceción ?, the problem is that x may be a number between 1 and 10000, I try to calculate with recursion but takes a long time, me You Might support with some other method to calculate, thank you.

Full text and comments »

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

By aslf010990, 10 years ago, In English

Hello everyone, I am trying to solve the following problem: link but I'm getting time limit exceeded, I am using the following code.

import java.io.*;
import java.util.*;
public class Main {
    static boolean used[];
    static TreeSet<String>ts;
    public static void main(String[] args) throws IOException {
        BufferedReader cin=new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(cin.readLine());
        while(n-->0)
        {
            String s=cin.readLine();
            ts=new TreeSet();
            used=new boolean[s.length()];
            permutations("",s,s.length(),0);
            Iterator it=ts.iterator();
            while(it.hasNext())
                System.out.println(it.next());
        }
    }
    private static void permutations(String per, String s, int t, int l) {
        if(l==t)
            ts.add(per);
        else
        {
            for(int i=0;i<t;i++)
            {
                if(!used[i])
                {
                    used[i]=true;
                    permutations(per+s.charAt(i),s,s.length(),l+1);
                    used[i]=false;
                }
            }
        }
    }
}

the problem is when generating the permutations, I have the following question, what is the fastest way to generate the permutations in java?, hope you can help me, greetings and sorry for my bad English.

Full text and comments »

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

By aslf010990, 10 years ago, In English

as we all know the world final of acm-icpc 2015 is very close , so I ask you : what is your top 5 ? mine is :

  1. St. Petersburg National Research University of IT, Mechanics and Optics
  2. University of Tokyo
  3. Shanghai Jiao Tong University
  4. University of Warsaw
  5. Lviv National University

Full text and comments »

  • Vote: I like it
  • -31
  • Vote: I do not like it

By aslf010990, 10 years ago, In English

Hello , I have a little doubt : Is there in c ++ the indexOf method ?, greetings

Full text and comments »

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

By aslf010990, 10 years ago, In English

Hello, I have a little Doubt, why in the world final of ACM-ICPC 2015, will Participate 6 teams of Egypt?, Greetings

Full text and comments »

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

By aslf010990, 10 years ago, In English

Hello everyone, I am currently learning to program lists, I would like to practice to improve my technique, I write for to ask them if they can suggest me some problems to be solved with lists, greetings and thanks in advance.

Full text and comments »

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

By aslf010990, 10 years ago, In English

Hi all, I have observed that several problems the arrays of 3 dimensions are used, I never used this type of vector, I hope you can help me and explain how it is used and what types of problems can be applied, excuse my bad English, Greetings and Happy Holidays to all.

Full text and comments »

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

By aslf010990, 11 years ago, In English

hi all. A few days ago I read a post in which a user asking advice about which is the best book to learn competitive programming mistakenly not list the names of the books mentioned in this publication, now I ask for help to give me some names competitive programming books because I want to learn more about this area is very interesting, I hope I can support. Greetings and thanks in advance.

Full text and comments »

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

By aslf010990, 11 years ago, In English

Hi all, here are the link of a site (surely many already know, but for those not here in this link: http://codingbat.com/) the name of the site is codinbat, is a small platform to practice and submit problems in java or Python, I hope you like it and help them into something, greetings and happy new year.

Full text and comments »

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

By aslf010990, 13 years ago, In English

I need information on graph theory specifically on issues such as bfs dfs bellman ford and dijkstra trees and also some greetings

my email is aslf010990@hotmail.com

Full text and comments »

  • Vote: I like it
  • -40
  • Vote: I do not like it