結果

問題 No.3116 More and more teleporter
ユーザー ks2m
提出日時 2025-04-18 21:16:07
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 656 bytes
コンパイル時間 1,966 ms
コンパイル使用メモリ 75,628 KB
実行使用メモリ 48,296 KB
最終ジャッジ日時 2025-04-18 21:16:22
合計ジャッジ時間 8,899 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		int n = Integer.parseInt(sa[0]);
		int q = Integer.parseInt(sa[1]);
		int ans = n - 1;
		PrintWriter pw = new PrintWriter(System.out);
		for (int i = 0; i < q; i++) {
			sa = br.readLine().split(" ");
			int t = Integer.parseInt(sa[0]);
			int x = Integer.parseInt(sa[1]);
			if (t == 1) {
				pw.println(ans);
			} else {
				int c = Integer.parseInt(sa[2]);
				ans = Math.min(ans, c + n - x);
			}
		}
		pw.flush();
		br.close();
	}
}
0