Skip to content

Instantly share code, notes, and snippets.

View nukopy's full-sized avatar

Yosuke Okuwaki nukopy

View GitHub Profile
@nukopy
nukopy / abc033_c.cpp
Created February 10, 2019 01:59
ABC033 - C: 数式の書き換え
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
ll ctoi(char c){
if('0' <= c && c <= '9') return (c-'0');
@nukopy
nukopy / abc088c.cpp
Created January 5, 2019 12:56
ABC088: C - Takahashi's Information
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <iterator> // std::back_inserter()
#include <set>
#include <map>
#include <algorithm> // std::copy()
#include <functional> // std::greater<T>()
#include <utility> // std::swap()
@nukopy
nukopy / abc014b.cpp
Created January 4, 2019 15:20
ABC014: B - 価格の合計
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <iterator> // std::back_inserter()
#include <set>
#include <map>
#include <algorithm> // std::copy()
#include <functional> // std::greater<T>()
#include <utility> // std::swap()
@nukopy
nukopy / bitset_sstream.cpp
Created January 4, 2019 14:55
decimal to binary string.
#include <iostream>
#include <string>
#include <bitset> // static_cast<std::bitset<8>>
#include <sstream> // std::stringstream
using namespace std;
int main() {
int num = 55;
stringstream ss;
ss << std::bitset<8>(num);
@nukopy
nukopy / abc017b.cpp
Created January 4, 2019 14:09
ABC017: B - choku語
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <iterator> // std::back_inserter()
#include <set>
#include <map>
#include <algorithm> // std::copy()
#include <functional> // std::greater<T>()
#include <utility> // std::swap()
@nukopy
nukopy / abc046b.cpp
Created January 4, 2019 12:55
ABC046: B - AtCoDeerくんとボール色塗り / Painting Balls with AtCoDeer
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <iterator> // std::back_inserter()
#include <set>
#include <map>
#include <algorithm> // std::copy()
#include <functional> // std::greater<T>()
#include <utility> // std::swap()
@nukopy
nukopy / abc027b.cpp
Created January 3, 2019 11:00
ABC027: B - 島と橋
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <iterator> // std::back_inserter()
#include <set>
#include <map>
#include <algorithm> // std::copy()
#include <functional> // std::greater<T>()
#include <utility> // std::swap()
@nukopy
nukopy / abc026b.cpp
Created January 2, 2019 15:34
ABC026: B - N重丸
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <iterator> // std::back_inserter()
#include <set>
#include <map>
#include <algorithm> // std::copy()
#include <functional> // std::greater<T>()
#include <utility> // std::swap()
@nukopy
nukopy / padding.cpp
Created January 2, 2019 07:58
Padding with STL, "ios", "iomanip" on C++.
// 左埋めパディング
// 必用なヘッダーインクルード
#include <ios> // std::left, std::right
#include <iomanip> // std::setw(int), std::setfill(char)
// macro 直後の要素をパディング
#define zero_pad(num) setfill('0') << std::right << setw(num)
#define space_pad(num) setfill(' ') << std::right << setw(num)
// std::left とすれば,右に '0' を埋めることができる
@nukopy
nukopy / abc060b.cpp
Created November 26, 2018 07:11
ABC060 B - Choice Intergers
#include <iostream>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
for (int i = 1; i <= B; ++i) {
if (A*i%B == C) {
cout << "YES" << "\n";