AtCoder Beginner Contest 111: D - Robot Arms

問題 問題文 https://atcoder.jp/contests/abc111/tasks/arc103_b 問題概要 N 個座標 (X_i, Y_i) が与えられる. 正整数 d_1, d_2, d_3, .. d_m を用意し, それぞれに対して (d_i, 0) (-d_i, 0) (0, d_i) (0, -d_i) のいずれかを加算することで, (X_i, Y_i) …

picoCTF 2018: shellcode

問題 問題文 This program executes any input you give it. Can you get a shell? You can find the program in /problems/shellcode_2_0caa0f1860741079dd0a66ccf032c5f4 on the shell server. Source. Hints Maybe try writing some shellcode? You also …

AtCoder Beginner Contest 112: D - Partition

問題 問題文 https://atcoder.jp/contests/abc112/tasks/abc112_d 問題概要 整数 N, M が与えられる. 各項の和が M となる 長さ N の数列 a のうち, a の最大公約数の最大値を求めよ. 解答例 指針 M の約数を考える 解説 の最大公約数を とすると, 数列 の各…

picoCTF 2018: quackme

問題 問題文 Can you deal with the Duck Web? Get us the flag from this program. You can also find the program in /problems/quackme_1_374d85dc071ada50a08b36597288bcfd. Hints: Objdump or something similar is probably a good place to start. 問…

AtCoder Beginner Contest 113: D - Number of Amidakuji

問題 問題文 https://atcoder.jp/contests/abc113/tasks/abc113_d 問題概要 あみだくじを作る. まず W 本の平行な縦線を引き, 次にそれらを繋ぐ横線を引いていく. それぞれの縦棒の長さは H + 1 であり, 横線の端点となれるのは上から 1, 2, 3 ... H の位置…

picoCTF 2018: leak-me

問題 問題文 Can you authenticate to this service and get the flag? Connect with nc 2018shell2.picoctf.com 23685. Source. Hints: Are all the system calls being used safely? Some people can have reallllllly long names you know.. 問題概要 脆…

AtCoder Beginner Contest 114: D - 756

問題 問題文 https://atcoder.jp/contests/abc114/tasks/abc114_d 問題概要 整数 が与えられる. の約数のうち, 約数がちょうど 75 個となる数はいくつあるか. 解答例 指針 N! を素因数分解する 解説 約数がちょうど 75個となる整数とは より p, q, r を異な…

picoCTF 2018: buffer overflow 1

問題 問題文 Okay now you're cooking! This time can you overflow the buffer and return to the flag function in this program? You can find it in /problems/buffer-overflow-1_1_8a16ff6a1b3cfb2e42c08d9090051a5d on the shell server. Source. Hint…

AtCoder Beginner Contest 115: D - Christmas

問題 問題文 https://beta.atcoder.jp/contests/abc115/tasks/abc115_d 問題概要 多次元バーガーを作る事を考える. 多次元バーガにはレベルがあり, レベル L バーガー (Lは 0 以上の整数) は以下のように定義される. L = 0 : パティ 1 枚のみで構成される. L…

OtterCTF: Gotta Go Deeper

問題 問題文 Rick and morty played with the configurations of the portal gun and accidentally got stuck in this picture. Help us get them out. GottaGoDeeper.png 問題概要 png ファイルが与えられる. 解答例 指針 binwalk + 青空白猫 解説 与えられ…

ABC054: C - One-stroke Path

問題 問題文 https://beta.atcoder.jp/contests/abc054/tasks/abc054_c 問題概要 頂点数: N , 辺の数: M の重みなし無向グラフが与えられる. ただし, このグラフは自己ループや二重辺を持たない. 頂点 1 を始点として, 全ての頂点を1度だけ通る経路は何通り…

picoCTF 2018: buffer overflow 0

問題 問題文 Let's start off simple, can you overflow the right buffer in this program to get the flag? You can also find it in /problems/buffer-overflow-0_2_aab3d2a22456675a9f9c29783b256a3d on the shell server. Source. Hints How can you tr…

AOJ 1625: Origami, or the art of folding paper

問題 問題文 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1625&lang=jp 問題概要 幅 n, 高さ m の長方形の紙が与えられる. (n, m は32以下の正整数) 紙を t回折る操作をした後 p 回穴を開ける. (t, p は20 以下の正整数) t 組の d_i, c_i が…

picoCTF 2018: in out error

問題 問題文 Can you utlize stdin, stdout, and stderr to get the flag from this program? You can also find it in /problems/in-out-error_4_c51f68457d8543c835331292b7f332d2 on the shell server Hints Maybe you can split the stdout and stderr o…

AOJ1618: A Garden with Ponds

問題 問題文 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1618&lang=jp 問題概要 面倒なので省略 解答例 指針 4重ループを回しすべての長方形について考える 解説 長方形の x の範囲 [lx, ry], y の範囲 [ly, ry] に関してループを回しすべて…

picoCTF 2017: Weird RSA

問題 問題文 We recovered some data. It was labeled as RSA, but what in the world are dq and dp Can you decrypt the ciphertext for us 問題概要 解答例 指針 中国人剰余定理 解説 与えられたファイルの中身を表示してみる. $ cat RSA.txt c: 95272795…

AOJ1617: Almost Identical Programs

問題 問題文 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1617&lang=jp 問題概要 2つの文字列が与えられる. 2つが完全に等しければ, IDENTICAL と 2つのプログラム中の対応する文字列定数1つだけが異なるならば CLOSE と それ以外の場合,DIF…

EKOPARTY PRE-CTF 2015: Perfect security

問題 問題文 It is not maybe so perfect. Hints: Use the golden math! crypto200.zip ※問題ファイルは下記のものを利用できる。 https://github.com/ctfs/write-ups-2015/tree/master/ekoparty-pre-ctf-2015/crypto/perfect-security 問題概要 暗号処理を…

AOJ DPL1: A - Coin Changing Problem

問題 問題文 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DPL_1_A 問題概要 額面が 円の m 種類の硬貨を使って n 円を支払うときの使用する硬貨の最小枚数を求めよ。 なお各額面のコインは何度でも使用できるものとし, 与えられるコインの額…

SECCON2017 Online CTF: Ps and Qs

問題 問題文 Ps and Qs Decrypt it. update: we fixed the flag, please try to submit again. psqs1-0dd2921c9fbdb738e51639801f64164dd144d0771011a1dc3d55da6fbcb0fa02.zip (pass:seccon2017) 問題ファイルは下記のリンクのものを利用できる。 https://gi…

POJ1611: The Suspects

問題 問題文 http://poj.org/problem?id=1611 問題概要 n 人の学生とその学生からなる m 個のグループが与えられる。 全ての学生に 0 ~ n−1 の番号が振られており 0 番目の学生に SARS という病気の感染の疑いがある。感染の疑いのある学生と同じグループの…

34C3 Junior CTF: spi

問題 問題文 I used to be a hero. Now I can't even handle this: Mitschnitt Hints: We messed up, the flag starts with 34C4 not 34C3, sorry! 問題概要 音声ファイルが与えられる。 解答例 指針 やるだけ 解説 与えられた ogg ファイルを VLC で再生速…

ABC084: D - 2017-like Number

問題 問題文 https://abc084.contest.atcoder.jp/tasks/abc084_d 問題概要 N も (N+1) / 2 も素数であるという条件を満たす奇数 N を 2017に似た数 とする。 個のクエリが与えられ, 各クエリでは奇数 が与えられる。 区間 で 2017に似た数となる奇数の個数を…

34C3 Junior CTF: ARM2

問題 問題文 Can you reverse engineer this code and get the flag? This code is ARM Thumb 2 code which runs on an STM32F103CBT6. You should not need such a controller to solve this challenge. There are 5 stages in total which share all the s…

POJ3380: Bridges

問題 問題文 http://poj.org/problem?id=3380 問題概要 頂点数が n の重み付き無向グラフが与えられる。 各頂点は島を表しており, ある島から他の島までの経路は 1 通りしか存在しない。 各島には 1 つの町がある。 町には 1 から n まで番号がつけられてお…

34C3 Junior CTF: dotr

問題 問題文 I implemented some crypto and encrypted my secret: 03_duCbr5e_i_rY_or cou14:L4G f313_Th_etrph00 Wh03UBl_oo?n07!_e Can you get it back? 問題概要 暗号化処理をする Python3 スクリプトと暗号文が与えられる。 平文を復号せよ。 解答例 …

ABC070: D - Transit Tree Path

問題 問題文 https://beta.atcoder.jp/contests/abc070/tasks/abc070_d 問題概要 頂点数が N の重み付き無向グラフが与えられる。 与えられるグラフは辺の数が N−1 本で閉路のない連結グラフ, すなわち木構造となっている。 頂点 から 頂点 K を経由しつつ, …

AlexCTF: CR3 What is this encryption?

問題 問題文 Fady assumed this time that you will be so n00b to tell what encryption he is using he send the following note to his friend in plain sight : p=0xa6055ec186de51800ddd6fcbf0192384ff42d707a55f57af4fcfb0d1dc7bd97055e8275cd4b78ec63…

AOJ0030: Sum of Integers

問題 問題文 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0030&lang=jp 問題概要 0 から 9 までの数字から異なる n 個の数を取り出して和が s となる組み合わせの数を求めよ。 例 n = 3, s = 6 のとき 0 ~ 9 までの数字から異なる3個の数の和…