跳到正文

题解

P9459 浴眼盯真 题解

Bc2_Ch1ckenPr1nce约 2 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2026年3月12日
篇幅
约 2 分钟
题目
P9459

版本

  1. v1当前

P9459 浴眼盯真 题解

题目分析

这道题很简单,我们先输入 a,b,c,da, b, c, d 四个字符串,如 a0=b0=ya_0 = b_0 = \text{y},且 c=dingc = \text{ding},d=zhend = \text{zhen},就输出 Yes,否则输出 No。

一定记得要输入 TT 组数据,我赛时就因为没输入 TT 组数据而导致 WA 了 22 次。

code

C++
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define qwq ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
const int N = 1e6 + 10;

namespace ioarray {
	auto read = [](int n, int *a) {
		for (int i = 1; i <= n; ++ i)
			cin >> a[i];
	};
	void print(int n, int *a, string s) {
		for (int i = 1; i <= n; ++ i) {
			cout << a[i];
			cout << s;
		}
		cout << endl;
	}
}
using namespace ioarray;

signed main() {
    int T;
    cin >> T;
    while (T --) {
        string a, b, c, d;
        cin >> a >> b >> c >> d;
        if (a[0] == 'y' && b[0] == 'y' && c == "ding" && d == "zhen") {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
    return 0;
}
原文