結果
| 問題 | No.2034 Anti Lexicography |
| コンテスト | |
| ユーザー |
occhan
|
| 提出日時 | 2026-07-19 13:02:23 |
| 言語 | TypeScript (6.0.2) |
| 結果 |
AC
|
| 実行時間 | 63 ms / 2,000 ms |
| + 964µs | |
| コード長 | 3,588 bytes |
| 記録 | |
| コンパイル時間 | 4,725 ms |
| コンパイル使用メモリ | 202,144 KB |
| 実行使用メモリ | 72,548 KB |
| 最終ジャッジ日時 | 2026-07-19 13:02:35 |
| 合計ジャッジ時間 | 7,995 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 |
ソースコード
// start
import * as fs from "node:fs";
function main() {
// ここに処理を記述します
let N = nextNum();
let S = next();
for (let i = 0; i < N; i++) {
print(String.fromCharCode(small_a_code+25-(S.charCodeAt(i)-small_a_code)));
}
// 処理終了
}
const less = <T>(a: T, b: T) => (a == b ? 0 : a < b ? -1 : 1)
const greater = <T>(a: T, b: T) => (a == b ? 0 : a < b ? 1 : -1)
const bigIntMax = (...args: bigint[]) => args.reduce((m, e) => (e > m ? e : m))
const bigIntMin = (...args: bigint[]) => args.reduce((m, e) => (e < m ? e : m))
const bigIntAbs = (arg: bigint) => (arg < 0 ? -arg : arg)
const bigIntSqrt = (n: bigint) => {
let x = BigInt(Math.floor(Math.sqrt(Number(n))));
while ((x+1n)*(x+1n) <= n) {
x++;
}
while (x*x > n) {
x--;
}
return x;
}
let inputs = "";
let inputArray: string[];
let currentIndex = 0;
let outputBuffer = "";
let yes = "Yes";
let no = "No";
let MOD998244353 = 998244353;
let small_a_code = 97;
let big_A_code = 65;
let dxy4 = [[-1,0],[0,1],[1,0],[0,-1]];
let dxy8 = [[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[-1,-1]];
let dir4 = ["U","R","D","L"];
// // インタラクティブ用
// // お決まりのインプットはコメントアウト、main関数にasyncを忘れない
// // 詳しくは典型ABC305-Fをチェック
// const readline = require("readline");
// const rl = readline.createInterface({
// input: process.stdin,
// output: process.stdout,
// });
// const it = rl[Symbol.asyncIterator]();
// const nextAwait = async () => {
// const { value } = await it.next();
// return value.trim();
// };
function next() {
return inputArray[currentIndex++];
}
function nextNum() {
return +next();
}
function nextBigInt() {
return BigInt(next());
}
function nexts(length: number) {
const arr: string[] = [];
for(let i = 0; i < length; ++i) arr[i] = next();
return arr;
}
function nextNums(length: number) {
const arr: number[] = [];
for(let i = 0; i < length; ++i) arr[i] = nextNum();
return arr;
}
function nextBigInts(length: number) {
const arr: bigint[] = [];
for(let i = 0; i < length; ++i) arr[i] = nextBigInt();
return arr;
}
function print(out: string | number | bigint): void;
function print<T>(out: Array<T>, separator: string): void;
function print<T>(out: string | number | bigint | Array<T>, separator?: string) {
if (Array.isArray(out)) {
outputBuffer += out.join(separator);
} else {
outputBuffer += out;
}
}
function println(out: string | number | bigint): void;
function println<T>(out: Array<T>, separator: string): void;
function println<T>(out: string | number | bigint | Array<T>, separator?: string) {
if (Array.isArray(out)) {
print(out, separator || "");
} else {
print(out);
}
print("\n");
}
function flush() {
console.log(outputBuffer);
}
// end
function readInput() {
const g = globalThis as any;
// Deno
if (typeof g.Deno !== "undefined") {
const chunks: Uint8Array[] = [];
const buf = new Uint8Array(1 << 16);
while (true) {
const n = g.Deno.stdin.readSync(buf) as number | null;
if (n === null) break;
if (n > 0) chunks.push(buf.slice(0, n));
}
const length = chunks.reduce((s, c) => s + c.length, 0);
const bytes = new Uint8Array(length);
let offset = 0;
for (const c of chunks) {
bytes.set(c, offset);
offset += c.length;
}
return new TextDecoder().decode(bytes);
}
// Node.js / Bun
return fs.readFileSync(0, "utf8");
}
inputs = readInput();
inputArray = inputs.trim().split(/\s+/);
main();
flush();
occhan