ACM-ICPC 2018 焦作賽區網路預賽 A. Magic Mirror
題解
題目大意 忽略大小寫判斷字串是否出現過
直接將字串轉換為全小寫判斷
AC程式碼
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
int main()
{
#ifdef LOCAL
freopen("C:/input.txt", "r", stdin);
#endif
int T;
cin >> T;
while (T--)
{
string str;
cin >> str;
for (int i = 0; i < str.size(); i++)
str[i] = tolower(str[i]);
if (str == "jessie")
cout << "Good guy!" << endl;
else
cout << "Dare you say that again?" << endl;
}
return 0;
}
相關推薦
ACM-ICPC 2018 焦作賽區網路預賽--A. Magic Mirror
描述 Jessie has a magic mirror. Every morning she will ask the mirror: ‘Mirror mirror tell me, who is the most beautiful girl in the world?’ I
ACM-ICPC 2018 焦作賽區網路預賽 A. Magic Mirror
題解 題目大意 忽略大小寫判斷字串是否出現過 直接將字串轉換為全小寫判斷 AC程式碼 #include <stdio.h> #include <bits/stdc++.h> using namespace std; typed
ACM-ICPC 2018 焦作賽區網路預賽 A. Magic Mirror
Every morning she will ask the mirror: 'Mirror mirror tell me, who is the most beautiful girl in the world?' If the mirror says her name,
ACM-ICPC 2018 焦作賽區網路預賽 A. Magic Mirror
1000ms 65536K Jessie has a magic mirror. Every morning she will ask the mirror: 'Mirror mirror tell me, who is the most beautiful girl
L. Poor God Water(ACM-ICPC 2018 焦作賽區網路預賽 快速矩陣冪)
God Water likes to eat meat, fish and chocolate very much, but unfortunately, the doctor tells him that some sequence of eating will make them poi
【多重揹包+二進位制優化】ACM-ICPC 2018 焦作賽區網路預賽 - K. Transport Ship
題目連結<https://nanti.jisuanke.com/t/31720> 題意: 給出若干個船,每個船都有的容量,和的數量。有Q次詢問,給出一定體積的貨物,問你恰好裝滿的方案數量。 題解: 很明顯的多重揹包,但是要加上二進位制優化。 所謂二進位制優
【dp】ACM-ICPC 2018 焦作賽區網路預賽 - B - Mathematical Curse
題目連結<https://nanti.jisuanke.com/t/31711> 題意: 有n個數,m個加減乘除的運算子。按順序取出m個數,進行對應的運算子操作。給你一個初始值,問能構成的最大結果是多少。 題解: 考慮只有加減這兩種運算子的情況,那麼可以想到一
ACM-ICPC 2018 焦作賽區網路預賽 H. String and Times(字尾自動機)
題目連結 題意: 求原串S中出現次數在[A,B]之間的子串的個數 解析: 字尾自動機的經典應用。 我是通過結合了求不同子串個數的d[]和不同子串出現次數的sz[]來做的。 在拓撲序遍歷字尾自動機的時候,我們求不同子串個數是預設d[]初始為1 的,因為預設一個狀態點本身也是
ACM-ICPC 2018 焦作賽區網路預賽 F. Modular Production Line(最小費用流)
題目連結 題意: 給你n個點,每一個點最多被用k次,每一次任務需要同時使用連續編號的若干個點,任務完成相應獲得價值, 並且所使用的點的使用次數-1,問你最大的價值多少 解析: 想了一個下午,想不出怎麼建圖,甚至懷疑是不是用最小費用流做的,後來晚上靈光一現。
ACM-ICPC 2018 焦作賽區網路預賽 I. Save the Room
題解 題目大意 給你一定空間 問你能不能用1*1*2的矩形填滿 所給空間只要有一個能被二整除則可以 AC程式碼 #include <stdio.h> #include <bits/stdc++.h> using names
ACM-ICPC 2018 焦作賽區網路預賽 G. Give Candies
題解 題目大意 按照順序分糖果 每個最少分1個 問有多少種情況 根據題意找到規律 答案為2的n-1次方 使用尤拉降冪和快速冪計算 AC程式碼 #include <stdio.h> #include <bits/stdc++.h>
ACM-ICPC 2018 焦作賽區網路預賽 I. Save the Room
Bob is a sorcerer. He lives in a cuboid room which has a length of AA, a width of BB and a height of CC, so we represent it as AA * BB *
ACM-ICPC 2018 焦作賽區網路預賽 G. Give Candies 打表+指數迴圈節 or尤拉降冪 一題多解
部落格目錄 原題 傳送門 26.61% 1000ms 65536K There are NN children in kindergarten. Miss Li bought them NN candies. To make the process mor
ACM-ICPC 2018 焦作賽區網路預賽 B. Mathematical Curse 動態規劃
部落格目錄 原題 題目傳送門 22.08% 1000ms 65536K A prince of the Science Continent was imprisoned in a castle because of his contempt for m
ACM-ICPC 2018 焦作賽區網路預賽 G Give Candies —— 大數
There are NN children in kindergarten. Miss Li bought them NN candies. To make the process more interesting, Miss Li comes up with
ACM-ICPC 2018 焦作賽區網路預賽G題
Give Candies 1000ms 65536K There are NN children in kindergarten. Miss Li bought them NN candies. To make the process more interesting
ACM-ICPC 2018 焦作賽區網路預賽 I. Save the Room(水)
樣例輸入 1 1 2 1 1 4 1 1 1 樣例輸出 Yes Yes No 題意:a*b*c的立方體,問能不能用1*1*2的立方體不重疊的放滿 思路:膽子放大,猜完就交,abc三遍任意
ACM-ICPC 2018 焦作賽區網路預賽 B Mathematical Curse —— dp
A prince of the Science Continent was imprisoned in a castle because of his contempt for mathematics when he was young, and was ent
ACM-ICPC 2018 焦作賽區網路預賽 E. Jiu Yuan Wants to Eat 樹鏈剖分 線段樹
題目大意 一顆樹,n各節點(n≤105n≤105)每個節點上有一個值aiai(ai≤264)ai≤264) 有四種操作 1. 將u到v路徑上所有節點值乘以x(x≤264)x≤264) 2. 將u到v路徑上所有節點值加上x(x≤264)x≤264)
I. Save the Room(ACM-ICPC 2018 焦作賽區網路預賽)
Bob is a sorcerer. He lives in a cuboid room which has a length of AA, a width of BB and a height of CC, so we represent it as AA * BB * C