Submission #1176741
Source Code Expand
#include "bits/stdc++.h" using namespace std; #ifdef _DEBUG #include "dump.hpp" #else #define dump(...) #endif //#define int long long #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--) #define all(c) begin(c),end(c) const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f; const int MOD = (int)(1e9) + 7; template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; } //inputに含まれるsearchを全てformatに置き換え 破壊的 void replace_all(string& input, const string& search, const string& format) { string::size_type pos = input.find(search); while (pos != string::npos) { input.replace(pos, search.size(), format); pos = input.find(search, pos + format.size()); } } signed main() { cin.tie(0); ios::sync_with_stdio(false); string s; getline(cin, s); replace_all(s, "Left", "<"); replace_all(s, "Right", ">"); replace_all(s, "AtCoder", "A"); cout << s << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - スペース高橋君 |
User | minaminao |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 1149 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example_0.txt, example_1.txt, example_2.txt |
All | corner_0.txt, corner_1.txt, corner_2.txt, example_0.txt, example_1.txt, example_2.txt, maxrand_0.txt, maxrand_1.txt, maxrand_2.txt, random_0.txt, random_1.txt, random_2.txt, random_3.txt, random_4.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
corner_0.txt | AC | 1 ms | 256 KB |
corner_1.txt | AC | 1 ms | 256 KB |
corner_2.txt | AC | 1 ms | 256 KB |
example_0.txt | AC | 1 ms | 256 KB |
example_1.txt | AC | 1 ms | 256 KB |
example_2.txt | AC | 1 ms | 256 KB |
maxrand_0.txt | AC | 1 ms | 256 KB |
maxrand_1.txt | AC | 1 ms | 256 KB |
maxrand_2.txt | AC | 1 ms | 256 KB |
random_0.txt | AC | 1 ms | 256 KB |
random_1.txt | AC | 1 ms | 256 KB |
random_2.txt | AC | 1 ms | 256 KB |
random_3.txt | AC | 1 ms | 256 KB |
random_4.txt | AC | 1 ms | 256 KB |