Submission #2530774
Source Code Expand
import java.io.IOException; import java.io.InputStream; import java.util.NoSuchElementException; public class Main { public static void main(String[] args) { FastScanner sc = new FastScanner(); int n = sc.nextInt(); int tmp = (int)Math.sqrt(n); System.out.println(tmp*tmp); } } class FastScanner { private final InputStream in = System.in; private final byte[] buffer = new byte[1024]; private int ptr = 0; private int buflen = 0; private boolean hasNextByte() { if (ptr < buflen) { return true; } else { ptr = 0; try { buflen = in.read(buffer); } catch (IOException e) { e.printStackTrace(); } if (buflen <= 0) { return false; } } return true; } private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1; } private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126; } private void skipUnprintable() { while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; } public boolean hasNext() { skipUnprintable(); return hasNextByte(); } public String next() { if (!hasNext()) throw new NoSuchElementException(); StringBuilder sb = new StringBuilder(); int b = readByte(); while (isPrintableChar(b)) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } public long nextLong() { if (!hasNext()) throw new NoSuchElementException(); long n = 0; boolean minus = false; int b = readByte(); if (b == '-') { minus = true; b = readByte(); } if (b < '0' || '9' < b) { throw new NumberFormatException(); } while (true) { if ('0' <= b && b <= '9') { n *= 10; n += b - '0'; } else if (b == -1 || !isPrintableChar(b)) { return minus ? -n : n; } else { throw new NumberFormatException(); } b = readByte(); } } public int nextInt() { long nl = nextLong(); if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException(); return (int) nl; } public double nextDouble() { return Double.parseDouble(next()); } }
Submission Info
Submission Time | |
---|---|
Task | B - Around Square |
User | mochimochi |
Language | Java8 (OpenJDK 1.8.0) |
Score | 200 |
Code Size | 2177 Byte |
Status | AC |
Exec Time | 71 ms |
Memory | 21332 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt, s3.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, s1.txt, s2.txt, s3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 69 ms | 18644 KB |
02.txt | AC | 67 ms | 19284 KB |
03.txt | AC | 69 ms | 21204 KB |
04.txt | AC | 69 ms | 21332 KB |
05.txt | AC | 69 ms | 21076 KB |
06.txt | AC | 67 ms | 15828 KB |
07.txt | AC | 67 ms | 20052 KB |
08.txt | AC | 69 ms | 18644 KB |
09.txt | AC | 68 ms | 19156 KB |
10.txt | AC | 68 ms | 21076 KB |
11.txt | AC | 67 ms | 17492 KB |
12.txt | AC | 69 ms | 20436 KB |
13.txt | AC | 67 ms | 18516 KB |
14.txt | AC | 68 ms | 20436 KB |
s1.txt | AC | 69 ms | 19028 KB |
s2.txt | AC | 71 ms | 18644 KB |
s3.txt | AC | 69 ms | 19796 KB |