The cost of a longsword costs 15 GP, as stated in the PHB Page 149. It can be used as your starting equipment, depending on which class you choose. You can also use the Starting Wealth By Class system to buy it.Remember that you can change your weapon during the campaign if your current one is not working for you.