Amedeo
SYMBIOSYS OF
PURPOSE & STYLE
Follow us

Search

未分類
  -  未分類

仕事中にワールドカップをばれないように見る CLI ツールを Rust で作ってみた こんにちは、@ekusiadadus です。日本が死の組をまさかの一位通過して本選出場を決めましたね。 ワールドカップ見たい……けど、仕事中にばれたら怒られる…… そんなときに仕事中にワールドカップを見るための CLI ツールを作ってみました。 (ついさっき PK で負けてしまいました 😢) How to use 🌸 World Cup 2022 CLI for Japanese football fans 🌸 Usage: samuraicli <COMMAND> Commands: real ⚽ワールドカップをリアルタイムで確認する search 🥅ワールドカップのツイートを取得する keisuke 📣本田圭佑の動向を取得する help Print this message or the help of the given subcommand(s) Options: -h, --help Print help information 12

Problem Reversort Note: The main parts of the statements of the problems "Reversort" and "Reversort Engineering" are identical, except for the last paragraph. The problems can otherwise be solved independently. Reversort is an algorithm to sort a list of distinct integers in increasing order. The algorithm is based on the "Reverse" operation. Each application of this operation reverses the order of some contiguous part of

Go言語でソート ソートしたい配列(スライス)をaとする。aの要素は、すべてint型とする。 1.昇順sort.Sort(sort.IntSlice(a)) 2.降順sort.Sort(sort.Reverse(sort.IntSlice(a))) 練習問題 [B - Card Game for Two](https://atcoder.jp/contests/abc088/tasks/abc088_b) package main import ( "fmt" "sort" ) func main() { var n int fmt.Scan(&n) a := make([]int, n) for i := 0; i < n; i++ { fmt.Scan(&a[i]) } sort.Sort(sort.Reverse(sort.IntSlice(a))) var t, u int for i := 0; i < n; i++ { if i%2 == 1 { t += a[i] } else { u += a[i] } } fmt.Println(u - t) } 参考 https://golang.org/pkg/sort