Numerous studies have examined substance use and smoking behavior among adolescents and university students. However, little is known about these behaviors among students undergoing university entrance tests, a critical transition period from adolescence to adulthood. The entrance test can significantly affect students' mental health, potentially leading to substance use. This study aims to investigate the prevalence of cigarette smoking and substance use among students taking these exams and the associated factors. A cross-sectional survey was carried out on September 4th and 11th, 2022 to collect data from 1,480 university entrance test-taking students using a convenience sampling technique. Chi-square tests and logistic regression were conducted using SPSS software. Besides, GIS mapping was used to visualize the distribution of substance use and smoking behavior across districts via ArcGIS. The study found a 10% prevalence of current tobacco smoking and 4% substance use. Females (OR = 1.98; 95% CI: 1.38-2.85), urban residence (OR = 2.03; 95% CI: 1.42-2.88), repeater (OR = 1.45; 95% CI: 1.02-2.06), anxiety (OR = 1.55, 95% CI: 1.10-2.19), burnout (OR = 1.51, 95% CI: 1.00-2.12), and suicidal behavior (OR = 1.57; 95% CI: 1.03-2.40) were the significant factors for cigarette use. Whereas the urban residence (OR = 1.91; 95% CI: 1.11-3.31), anxiety (OR = 2.47, 95% CI: 1.45-4.20), and suicidal behavior (OR = 2.76; 95% CI: 1.55-4.92) significantly increased the risk of substance use. GIS analysis revealed males varied in substance use and females in tobacco smoking by district. Repeat test-takers were associated with district variations in both smoking and substance use. Educational institutions, public health authorities, and policymakers must implement mental health support and substance use prevention programs for students. Integrating mental health education, providing resources, and enforcing regulations can promote healthier coping strategies and reduce substance use risks among students.