Submission #17445269
Source Code Expand
Copy
//package Atcoder; import java.util.*; import java.io.*; public class Main { static final int mod=(int)1e9+7; static final int inf=(int)1e9; static final long INF=(long)1e18; public static void main(String[] args) { FastScanner fs=new FastScanner(); long n=fs.nextLong(); ArrayList<Long> list = new ArrayList<>(); for(long i=1;i*i<=n;i++) { if(n%i==0) { list.add(i); if(i!=n/i)list.add(n/i); } } Collections.sort(list); for(long i:list)System.out.println(i); } } class FastScanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public String next() { while (!st.hasMoreTokens()) try { st=new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } return st.nextToken(); } int[] sort(int arr[]) { ArrayList<Integer> list = new ArrayList<Integer>(); for(int i=0;i<arr.length;i++)list.add(arr[i]); Collections.sort(list); for(int i=0;i<arr.length;i++) { arr[i]=list.get(i); } return arr; } char[] charsort(char arr[]) { ArrayList<Character> list = new ArrayList<>(); for(char c:arr)list.add(c); Collections.sort(list); for(int i=0;i<list.size();i++) { arr[i]=list.get(i); } return arr; } long[] longsort(long arr[]) { ArrayList<Long> list = new ArrayList<Long>(); for(long i:arr)list.add(i); Collections.sort(list); for(int i=0;i<arr.length;i++) { arr[i]=list.get(i); } return arr; } public int nextInt() { return Integer.parseInt(next()); } public int[] readArray(int n) { int[] arr=new int[n]; for (int i=0; i<n; i++) arr[i]=nextInt(); return arr; } public long nextLong() { return Long.parseLong(next()); } public long[] longreadArray(int n) { long[] a=new long[n]; for (int i=0; i<n; i++) a[i]=nextLong(); return a; } }
Submission Info
Submission Time | |
---|---|
Task | C - Cream puff |
User | Sanju250406 |
Language | Java (OpenJDK 11.0.6) |
Score | 300 |
Code Size | 2081 Byte |
Status | AC |
Exec Time | 177 ms |
Memory | 35800 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, hand_12.txt, hand_13.txt, hand_14.txt, hand_15.txt, hand_88.txt, hand_99.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
hand_01.txt | AC | 90 ms | 32548 KB |
hand_02.txt | AC | 83 ms | 32480 KB |
hand_03.txt | AC | 145 ms | 34564 KB |
hand_04.txt | AC | 86 ms | 32460 KB |
hand_05.txt | AC | 83 ms | 32608 KB |
hand_06.txt | AC | 93 ms | 32660 KB |
hand_07.txt | AC | 82 ms | 32452 KB |
hand_08.txt | AC | 87 ms | 32724 KB |
hand_09.txt | AC | 96 ms | 32880 KB |
hand_10.txt | AC | 169 ms | 35748 KB |
hand_11.txt | AC | 177 ms | 35800 KB |
hand_12.txt | AC | 120 ms | 34032 KB |
hand_13.txt | AC | 124 ms | 33908 KB |
hand_14.txt | AC | 87 ms | 32668 KB |
hand_15.txt | AC | 84 ms | 32708 KB |
hand_88.txt | AC | 99 ms | 32948 KB |
hand_99.txt | AC | 78 ms | 32436 KB |
random_01.txt | AC | 82 ms | 32780 KB |
random_02.txt | AC | 74 ms | 32464 KB |
random_03.txt | AC | 86 ms | 32684 KB |
random_04.txt | AC | 71 ms | 32460 KB |
random_05.txt | AC | 78 ms | 32732 KB |
random_06.txt | AC | 74 ms | 32600 KB |
sample_01.txt | AC | 61 ms | 32220 KB |
sample_02.txt | AC | 73 ms | 32476 KB |
sample_03.txt | AC | 78 ms | 32712 KB |