Skip to content

Instantly share code, notes, and snippets.

@if1live
Last active January 17, 2022 16:14
Show Gist options
  • Save if1live/68086baccd7cea98de6b506a4073888b to your computer and use it in GitHub Desktop.
Save if1live/68086baccd7cea98de6b506a4073888b to your computer and use it in GitHub Desktop.
https://www.acmicpc.net/ typescript + windows + powershell template
import fs = require('fs')
function read_stdin(): string {
return fs.readFileSync(0).toString();
}
const chunk = read_stdin();
const numbers = chunk.split('\n')[0].split(' ').map(x => parseInt(x, 10));
const [a, b] = numbers;
const c = a + b;
process.stdout.write(c.toString());
@if1live
Copy link
Author

if1live commented Jan 17, 2022

pnpm init
pnpm i @types/node ts-node typescript -D

echo "1 2" > data.txt
echo "Get-Content data.txt | pnpx ts-node-transpile-only main.ts" > run.ps1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment