• [HIHO1082]然而沼跃鱼早就看穿了一切(字符串水题)


    题目链接:http://hihocoder.com/problemset/problem/1082

    数据范围小,胡搞。

      1     /*
      2 ━━━━━┒ギリギリ♂ eye!
      3 ┓┏┓┏┓┃キリキリ♂ mind!
      4 ┛┗┛┗┛┃\○/
      5 ┓┏┓┏┓┃ /
      6 ┛┗┛┗┛┃ノ)
      7 ┓┏┓┏┓┃
      8 ┛┗┛┗┛┃
      9 ┓┏┓┏┓┃
     10 ┛┗┛┗┛┃
     11 ┓┏┓┏┓┃
     12 ┛┗┛┗┛┃
     13 ┓┏┓┏┓┃
     14 ┃┃┃┃┃┃
     15 ┻┻┻┻┻┻
     16 */
     17 #include <algorithm>
     18 #include <iostream>
     19 #include <iomanip>
     20 #include <cstring>
     21 #include <climits>
     22 #include <complex>
     23 #include <fstream>
     24 #include <cassert>
     25 #include <cstdio>
     26 #include <bitset>
     27 #include <vector>
     28 #include <deque>
     29 #include <queue>
     30 #include <stack>
     31 #include <ctime>
     32 #include <set>
     33 #include <map>
     34 #include <cmath>
     35 using namespace std;
     36 #define fr first
     37 #define sc second
     38 #define cl clear
     39 #define BUG puts("here!!!")
     40 #define W(a) while(a--)
     41 #define pb(a) push_back(a)
     42 #define Rint(a) scanf("%d", &a)
     43 #define Rll(a) scanf("%lld", &a)
     44 #define Rs(a) scanf("%s", a)
     45 #define Cin(a) cin >> a
     46 #define FRead() freopen("in", "r", stdin)
     47 #define FWrite() freopen("out", "w", stdout)
     48 #define Rep(i, len) for(int i = 0; i < (len); i++)
     49 #define For(i, a, len) for(int i = (a); i < (len); i++)
     50 #define Cls(a) memset((a), 0, sizeof(a))
     51 #define Clr(a, x) memset((a), (x), sizeof(a))
     52 #define Full(a) memset((a), 0x7f7f7f, sizeof(a))
     53 #define lrt rt << 1
     54 #define rrt rt << 1 | 1
     55 #define pi 3.14159265359
     56 #define RT return
     57 #define lowbit(x) x & (-x)
     58 #define onenum(x) __builtin_popcount(x)
     59 typedef long long LL;
     60 typedef long double LD;
     61 typedef unsigned long long ULL;
     62 typedef pair<int, int> pii;
     63 typedef pair<string, int> psi;
     64 typedef pair<LL, LL> pll;
     65 typedef map<string, int> msi;
     66 typedef vector<int> vi;
     67 typedef vector<LL> vl;
     68 typedef vector<vl> vvl;
     69 typedef vector<bool> vb;
     70 
     71 const int maxn = 220;
     72 const char* zyy = "marshtomp";
     73 const char* fjx = "fjxmlhx``";
     74 
     75 char s[maxn], t[maxn];
     76 int n, m;
     77 
     78 char* cvt(char* t) {
     79     for(int i = 0; t[i]; i++) {
     80         if(t[i] >= 'A' && t[i] <= 'Z') t[i] = t[i] - 'A' + 'a';
     81     }
     82     return t;
     83 }
     84 
     85 bool ok(char* t) {
     86     bool flag = 1;
     87     Rep(i, m) {
     88         if(t[i] != zyy[i]) {
     89             flag = 0;
     90             break;
     91         }
     92     }
     93     return flag;
     94 }
     95 
     96 int main() {
     97     // FRead();
     98     m = strlen(zyy);
     99     while(gets(s)) {
    100         n = strlen(s);
    101         Rep(i, n) {
    102             Cls(t);
    103             Rep(j, m) t[j] = s[i+j];
    104             if(ok(cvt(t))) {
    105                 Rep(k, m) t[k] = fjx[k];
    106                 Rep(j, m) s[i+j] = t[j];
    107             }
    108         }
    109         Rep(i, n) {
    110             if(s[i] == '`') continue;
    111             printf("%c", s[i]);
    112          }
    113         printf("
    ");
    114     }
    115     RT 0;
    116 }
  • 相关阅读:
    获取小程序码
    获取目标地与当前地距离
    小程序图片预览
    地图导航
    Jquery无缝滚动
    短信验证
    根据经纬度获取地址
    微信小程序中使用emoji表情
    小程序图片上传
    地球人类的牢笼
  • 原文地址:https://www.cnblogs.com/kirai/p/5590338.html
Copyright © 2020-2023  润新知