結果
問題 | No.2843 Birthday Present Struggle |
ユーザー | tenten |
提出日時 | 2024-08-26 13:06:37 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 114 ms / 2,000 ms |
コード長 | 1,860 bytes |
コンパイル時間 | 3,277 ms |
コンパイル使用メモリ | 82,868 KB |
実行使用メモリ | 51,852 KB |
最終ジャッジ日時 | 2024-08-26 13:06:47 |
合計ジャッジ時間 | 9,339 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
ソースコード
import java.io.*; import java.util.*; import java.util.function.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); sc.nextInt(); sc.nextInt(); sc.nextInt(); sc.nextInt(); sc.nextInt(); Point p = new Point(sc.nextInt(), sc.nextInt()); List<Point> list = new ArrayList<>(); list.add(p.add(-1, 0)); list.add(p.add(1, 0)); list.add(p.add(0, -1)); list.add(p.add(0, 1)); System.out.println(4); System.out.println(list.stream().map(x -> x.toString()).collect(Collectors.joining("\n"))); } static class Point { int x; int y; public Point(int x, int y) { this.x = x; this.y = y; } public Point add(int a, int b) { return new Point(x + a, y + b); } public String toString() { return x + " " + y; } } } class Scanner { BufferedReader br; StringTokenizer st = new StringTokenizer(""); public Scanner() { try { br = new BufferedReader(new InputStreamReader(System.in)); } catch (Exception e) { } } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String next() { try { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } } catch (Exception e) { e.printStackTrace(); } finally { return st.nextToken(); } } }