結果
| 問題 | No.3447 Power Projection(constant) |
| コンテスト | |
| ユーザー |
37zigen
|
| 提出日時 | 2026-02-20 21:27:53 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 65 ms / 2,000 ms |
| コード長 | 6,519 bytes |
| 記録 | |
| コンパイル時間 | 7,219 ms |
| コンパイル使用メモリ | 99,684 KB |
| 実行使用メモリ | 44,948 KB |
| 最終ジャッジ日時 | 2026-02-20 21:28:04 |
| 合計ジャッジ時間 | 10,351 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.math.BigInteger;
import java.nio.file.Files;
import java.nio.file.OpenOption;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map.Entry;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Optional;
import java.util.Queue;
import java.util.Random;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.DoubleUnaryOperator;
import java.util.function.LongToDoubleFunction;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.random.RandomGenerator;
import java.util.stream.Stream;
class FastScanner {
private static FastScanner instance = null;
private final InputStream in = System.in;
private final byte[] buffer = new byte[1024];
private int ptr = 0;
private int buflen = 0;
private FastScanner() {
}
public static FastScanner getInstance() {
if (instance == null) {
instance = new FastScanner();
}
return instance;
}
private boolean hasNextByte() {
if (ptr < buflen) {
return true;
}
ptr = 0;
try {
buflen = in.read(buffer);
} catch (IOException e) {
e.printStackTrace();
}
return buflen > 0;
}
private int readByte() {
if (hasNextByte()) {
return buffer[ptr++];
} else {
return -1;
}
}
private boolean isPrintableChar(int c) {
return (33 <= c) && (c <= 126);
}
public boolean hasNext() {
while (hasNextByte() && (!isPrintableChar(buffer[ptr]))) {
ptr++;
}
return hasNextByte();
}
public long nextLong() {
if (!hasNext()) {
throw new NoSuchElementException();
}
long n = 0;
boolean minus = false;
int b = readByte();
if (b == '-') {
minus = true;
b = readByte();
}
while ((b >= '0') && (b <= '9')) {
// n = n * 10 + (b - '0');
n = ((n << 1) + (n << 3)) + (b - '0');
b = readByte();
}
return minus ? -n : n;
}
public int nextInt() {
return ((int) (nextLong()));
}
}
class MergeFiles {}
class MyPrintWriter extends PrintWriter {
private static MyPrintWriter instance = null;
private MyPrintWriter() {
super(System.out);
}
public static MyPrintWriter getInstance() {
if (instance == null) {
instance = new MyPrintWriter();
}
return instance;
}
public void println(boolean[][] a) {
for (int i = 0; i < a.length; i++) {
println(a[i], " ");
}
}
public void println(boolean[] a, String separator) {
for (int i = 0; i < a.length; ++i) {
super.print((a[i] ? 1 : 0) + (i == (a.length - 1) ? "\n" : separator));
}
}
}
class MathUtils {
public static long pow(long a, long n) {
if (n == 0) {
return 1;
}
return MathUtils.pow(a * a, n / 2) * ((n % 2) == 1 ? a : 1);
}
}
public class Main implements Runnable {
public static void main(String[] args) throws IOException {
Thread.setDefaultUncaughtExceptionHandler((t, e) -> System.exit(1));
// Runtime runtime = Runtime.getRuntime();
// new Thread(null, new Main(), "MainThreadWithLargeStack", (1024 * 1024) * 1024).start();
// new Main().test();
// new Main().gen();
new Main().run();
// long usedMemory = runtime.totalMemory() - runtime.freeMemory();
// System.err.printf("使用メモリ: %.2f MB%n", usedMemory / 1024.0 / 1024.0);
MyPrintWriter.getInstance().flush();
}
@Override
public void run() {
Random rnd = new Random();
FastScanner sc = FastScanner.getInstance();
MyPrintWriter pw = MyPrintWriter.getInstance();
int N = sc.nextInt();
int A = sc.nextInt();
int B = sc.nextInt();
for (int i = 0; i < N; i++) {
pw.println(A * MathUtils.pow(B, i));
}
}
}
// --- Original Code ---
// package template;
//
// import java.io.IOException;
// import java.util.Arrays;
// import java.util.Random;
//
// import lib.tools.FastScanner;
// import lib.tools.MergeFiles;
// import lib.tools.MyPrintWriter;
// import lib.util.MathUtils;
// import lib.util.TreapMultiSet;
//
// public class Main implements Runnable {
//
// public static void main(String[] args) throws IOException {
// // Runtime runtime = Runtime.getRuntime();
// // new Thread(null, new Main(), "MainThreadWithLargeStack", (1024 * 1024) * 1024).start();
// // new Main().test();
// // new Main().gen();
// new Main().run();
// // long usedMemory = runtime.totalMemory() - runtime.freeMemory();
// // System.err.printf("使用メモリ: %.2f MB%n", usedMemory / 1024.0 / 1024.0);
// MyPrintWriter.getInstance().flush();
// MergeFiles.export();
// }
//
// @Override
// public void run() {
// Random rnd = new Random();
// FastScanner sc = FastScanner.getInstance();
// MyPrintWriter pw = MyPrintWriter.getInstance();
// int N=sc.nextInt();
// int A=sc.nextInt();
// int B=sc.nextInt();
// for (int i = 0; i < N; i++) {
// pw.println(A*MathUtils.pow(B, i));
// }
//
// }
//
// void gen() {
// Random rnd = new Random();
// MyPrintWriter pw = MyPrintWriter.getInstance();
// }
//
// void test() {
// Random rnd = new Random();
// for (int TEST = 0; TEST < 10000; TEST++) {
// }
// }
//
// void abc() {
// Random rnd = new Random();
// int a = rnd.nextInt(212, 445);
// System.out.println(a);
// }
//
// void tr(Object... objects) {
// System.out.println(Arrays.deepToString(objects));
// }
//
//
//
//
// }
//
//
//
//
37zigen