提出 #38779973
ソースコード 拡げる
#include <iostream>
#include <string>
#include <numeric>
#include <vector>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <set>
#include <iomanip>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <cctype>
#include <bitset>
#include <cassert>
#include <sstream>
#include <chrono>
#include <regex>
using namespace std;
using namespace chrono;
typedef long long ll;
#define int ll
#define pb push_back
#define eb emplace_back
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define repon(i,x) for(int i=0;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define REV(x) reverse(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define all(x) x.begin(),x.end()
#define si(x) int(x.size())
#define popcnt(x) __builtin_popcountll(x)
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;
template<class T> using vvvc = vector<vector<vector<T>>>;
template<class T> using vvvvc = vector<vector<vector<vector<T>>>>;
const ll INF = 1LL << 60;
const ll mod = 1000000007;
//const ll mod = 998244353;
template<class T> void pval(T s, int pre=0, int zp=0){
if (zp == 0) cout << fixed << setprecision(pre);
else cout << setfill('0') << setw(zp);
cout << s << endl;
}
template<class T> void parrV(vc<T> a){
rep(i, (T)a.size()) pval(a[i]);
}
template<class T> void parrH(vc<T> a){
rep(i, (T)a.size()){
if(i) cout << " ";
cout << a[i];
}
cout << endl;
}
template<class T> void parrV(set<T> a){
rep(i, (T)a.size()) pval(*next(a.begin(), i));
}
template<class T> void parrV(set<pair<T,T>> a){
rep(i, (T)a.size()) cout << next(a.begin(), i)->fi << " " << next(a.begin(), i)->sc << endl;
}
template<class T> void parrH(set<T> a){
rep(i, (T)a.size()){
if(i) cout << " ";
cout << *next(a.begin(), i);
}
cout << endl;
}
template<class T> void parrV(vc<pair<T,T>> a){
rep(i, (T)a.size()){
cout << next(a.begin(), i)->fi << " " << next(a.begin(), i)->sc << endl;
}
}
template<class T> void parrV(vc<pair<char,T>> a){
rep(i, (T)a.size()){
cout << next(a.begin(), i)->fi << " " << next(a.begin(), i)->sc << endl;
}
}
template<class T> void parrV(vc<pair<string,T>> a){
rep(i, (T)a.size()){
cout << next(a.begin(), i)->fi << " " << next(a.begin(), i)->sc << endl;
}
}
template<class T> void parrV(vc<map<T,T>> a){
for(auto x: a){
cout << x.fi << " " << x.sc << endl;
}
}
template<class T> void parrV(vc<map<char,T>> a){
for(auto x: a){
cout << x.fi << " " << x.sc << endl;
}
}
template<class T> void parrV(vc<map<string,T>> a){
for(auto x: a){
cout << x.fi << " " << x.sc << endl;
}
}
template<class T> void parr2s(vvc<T> a, bool setmaxlen=false){
int max_len = 0;
if(setmaxlen){
int max_val = -INF;
rep(i, (T)a.size()){
rep(j, (T)a.size()){
max_val = max(a[i][j], max_val);
}
}
while(max_val!=0){
max_val /= 10;
max_len++;
}
}
rep(i, (T)a.size()){
rep(j, (T)a[0].size()){
if(j) cout << " ";
if(setmaxlen) cout << setw(max_len) << a[i][j];
else cout << a[i][j];
}
cout << endl;
}
cout << endl;
}
template<class T> void parr2(vvc<T> a){
rep(i, (T)a.size()){
rep(j, (T)a[0].size()){
cout << a[i][j];
}
cout << endl;
}
cout << endl;
}
int modpow(int a, int b, int m) {
int p = 1, q = a;
rep(i,63){
if ((b & (1LL << i)) != 0) {
p *= q;
p %= m;
}
q *= q;
q %= m;
}
return p;
}
struct mint {
ll x; //typedef long long ll;
mint(ll x=0):x((x%mod+mod)%mod){}
mint& operator+=(const mint a) {
if ((x += a.x) >= mod) x -= mod;
return *this;
}
mint& operator-=(const mint a) {
if ((x += mod-a.x) >= mod) x -= mod;
return *this;
}
mint& operator*=(const mint a) {
(x *= a.x) %= mod;
return *this;
}
mint operator+(const mint a) const {
mint res(*this);
return res+=a;
}
mint operator-(const mint a) const {
mint res(*this);
return res-=a;
}
mint operator*(const mint a) const {
mint res(*this);
return res*=a;
}
mint pow(ll t) const {
if (!t) return 1;
mint a = pow(t>>1);
a *= a;
if (t&1) a *= *this;
return a;
}
// for prime mod
mint inv() const {
return pow(mod-2);
}
mint& operator/=(const mint a) {
return (*this) *= a.inv();
}
mint operator/(const mint a) const {
mint res(*this);
return res/=a;
}
};
struct combination {
vector<mint> fact, ifact;
combination(int n):fact(n+1),ifact(n+1) {
assert(n < mod);
fact[0] = 1;
for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
ifact[n] = fact[n].inv();
for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
}
mint operator()(int n, int k) {
if (k < 0 || k > n) return 0;
return fact[n]*ifact[k]*ifact[n-k];
}
};
template<class T> bool chmin(T& a, T b){
if(a > b){
a = b;
return true;
}else return false;
}
template<class T> bool chmax(T& a, T b){
if(a < b){
a = b;
return true;
}else return false;
}
struct Edge{
int to;
long long w;
Edge(int to, long long w): to(to), w(w){}
};
using Graph = vvc<int>;
//using Graph = vvc<Edge>;
/*
int n, m; cin >> n >> m;
Graph G(n);
rep(i,m){
int a, b; cin >> a >> b; a--; b--;
G[a].push_back(b);
G[b].push_back(a);
}
int n, m; cin >> n >> m;
Graph G(n);
rep(i,m){
int a, b; int w; cin >> a >> b >> w; a--; b--;
G[a].push_back(Edge(b, w));
}
rep(bit, (1<<n)){
if(popcnt(bit) >= 5) continue;
rep(i,n){
if(bit & (1<<i)){
}
}
}
*/
signed main(){
string s; cin >> s;
rep(i,si(s)){
if(s[i] == '1') cout << 0;
else cout << 1;
}
cout << endl;
return 0;
}
提出情報
| 提出日時 |
|
| 問題 |
A - flip |
| ユーザ |
neustein |
| 言語 |
C++ (GCC 9.2.1) |
| 得点 |
100 |
| コード長 |
6754 Byte |
| 結果 |
AC |
| 実行時間 |
7 ms |
| メモリ |
3544 KiB |
ジャッジ結果
| セット名 |
Sample |
All |
| 得点 / 配点 |
0 / 0 |
100 / 100 |
| 結果 |
|
|
| セット名 |
テストケース |
| Sample |
00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All |
00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_small_03.txt, 01_small_04.txt, 02_max_05.txt, 02_max_06.txt, 02_max_07.txt |
| ケース名 |
結果 |
実行時間 |
メモリ |
| 00_sample_00.txt |
AC |
7 ms |
3372 KiB |
| 00_sample_01.txt |
AC |
4 ms |
3544 KiB |
| 00_sample_02.txt |
AC |
3 ms |
3444 KiB |
| 01_small_03.txt |
AC |
2 ms |
3480 KiB |
| 01_small_04.txt |
AC |
2 ms |
3392 KiB |
| 02_max_05.txt |
AC |
2 ms |
3476 KiB |
| 02_max_06.txt |
AC |
4 ms |
3532 KiB |
| 02_max_07.txt |
AC |
2 ms |
3476 KiB |