This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import json | |
""" | |
explanation of json-module | |
json.load(file_obj) : file_obj --> dict | |
json.loads(json_str) : json_str --> dict | |
json.dumps(dict) : dict --> json_str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import json | |
""" | |
explanation of json-module | |
json.load(file_obj) : file_obj --> dict | |
json.loads(json_str) : json_str --> dict | |
json.dumps(dict) : dict --> json_str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 左埋めパディング | |
// 必用なヘッダーインクルード | |
#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' を埋めることができる |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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() |
OlderNewer