Physics informed neural networks (PINNs) have been a well-known tool in solving forward and inverse partial differential equations (PDEs) problem. In particular, for the forward problem, only the initial/boundary conditions and the equation itself as the physical information are needed to obtain the predicted solution within the definition domain. However, some existing works show that the standard PINN method is insufficient for solving complex problems. For the relatively complex one-dimensional Euler equation problem, due to the limited accuracy of the standard PINN method, the algorithm is improved in two aspects in this study. First, a gradient-related weight function is introduced into the loss function and the framework of gradient-weighted physics-informed neural networks (gwPINNs) is proposed. In particular, the weight function is carefully designed. Second, the sequence-to-sequence (seq2seq) learning is applied in the training process to improve the precision. Then, four cases of Riemann problems are solved using the improved algorithm. The results show that the improved algorithm can obtain high accuracy in solving these problems, and verify the feasibility of solving one-dimensional Euler equation based on the improved PINN method.