Squary Given N integer, is it possible to add at least 1 and at most K elements such that the sum of the squares of all elements in list equals square of sum of the all elements? solution Let $$ a_i $$ or A be the list of the given n elements. Let $$ b_j $$ be the list of the elements to add the `A` list. $$(\sum_{i}a_i
solution
Check a letter appearance
First, check all of the middle letters, which all letters other than the first and last consecutive segment of letters.
If a letter in middle letter appears more than one input string, it is impossible to construct the megatower.
Google Code Jam 2022 Qual solutions A. Punched Cards Given R and C, print the matrix with RxC Punched Card Python. Limits Time limit: 5 seconds.Memory limit: 1 GB. Test Set 1 (Visible Verdict) 1≤T≤811≤T≤81.2≤R≤102≤R≤10.2≤C≤102≤C≤10. Solution /** * author: ekusiadadus * created: 02.04.2022 15:34:43 **/ #include<bits/stdc++.h> using namespace std; using i64 = long long; int main(){ cin.tie(0); ios_base::sync_with_stdio(false); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif int
Auto Create and Auto Merge using GitHub Actions by Cron
※2022/3/23 書きかけです。気が向いたら、更新します。 Flutter で動画配信アプリ作る Tadas Petra さんという、FlutterやLive Streaming アプリを開発されている方が、FlutterでAgoraを使用してLive Streaming アプリ開発の解説をされていたので、実際にやってみました。 Clubhouseとか、Agoraを使っています。https://www.clubhouse.com/ 一応、作成したものは公開しています。 GitHubhttps://github.com/ekusiadadus/flutter_streamer 今回は、個人的に躓いた箇所だけ備忘録としておいておきます。実際に作りたい方は、YouTube見てください。 https://www.youtube.com/watch?v=hN4Q04ODOEw Agora準備 https://www.agora.io/en/ Agoraからプロジェクトを作成します。 この時、Tokenを使用するようにすると、YouTube動画通りにはいかないです。Testing mode でやるとよいです。 ちなみに、Token 発行してもできます。 後で、詳しく書きますが、YouTubeではTokenとか直書きだったので、Flutteの勉強がてら環境変数に書き出しました。.envファイルを作成して、 AGORA_ID= AGORA_TOKEN= みたいな感じで管理します。Tokenを発行した場合は、participant.dart 等で、初期化する際、Tokenを引数に与えるとTokenありで作成できます。 環境変数 環境変数を取得する際ですが、utils/const.dart で、YouTubeでは直書きしていたのですが、git管理できなくなるので環境変数に書き出しました。 class EnvironmentConfig { static const agoraId = String.fromEnvironment( 'AGORA_ID', defaultValue: 'AGORA_ID', ); static const agoraChannelName = String.fromEnvironment( 'AGORA_CHANNEL_NAME', defaultValue: 'test', ); static const agoraToken = String.fromEnvironment('AGORA_TOKEN', defaultValue: 'test'); } 呼び出すときは、こんな感じで呼び出します。 class
パン屋のアルゴリズムとは、並行プログラミングにおいて、安全に相互排除を行うためのアルゴリズムです。
特に、アトミック処理を前提としていない場合用いられます。。
並行プログラミング 入門を読んでいて、詰まったので自分なりに整理します。
Go 言語+Elasticsearch で簡易求人サイトバックエンド構築
Windows 11 が発表されてから、ずっと気になっていました。 今日(2021年10月5日)から、Windows 11 アップグレードが解禁されたので早速 Windows 11 にアップグレードしました。