Submission #2713380
Source Code Expand
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = 0; int tmp = a; for(int i = 0;i<String.valueOf(a).length();i++){ b += tmp % 10; tmp = tmp/10; } if(a % b == 0){ System.out.println("Yes"); }else{ System.out.println("No"); } } }
Submission Info
Submission Time | |
---|---|
Task | B - Harshad Number |
User | aaaa0424 |
Language | Java8 (OpenJDK 1.8.0) |
Score | 200 |
Code Size | 470 Byte |
Status | AC |
Exec Time | 94 ms |
Memory | 21972 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 91 ms | 19924 KB |
02.txt | AC | 90 ms | 21076 KB |
03.txt | AC | 92 ms | 21972 KB |
04.txt | AC | 90 ms | 19028 KB |
05.txt | AC | 91 ms | 18764 KB |
06.txt | AC | 92 ms | 19284 KB |
07.txt | AC | 91 ms | 18644 KB |
08.txt | AC | 91 ms | 19924 KB |
09.txt | AC | 92 ms | 18768 KB |
10.txt | AC | 92 ms | 19924 KB |
sample_01.txt | AC | 93 ms | 18768 KB |
sample_02.txt | AC | 92 ms | 19540 KB |
sample_03.txt | AC | 94 ms | 19668 KB |