計蒜客之模擬篇
#include <stdio.h>
#define LEN 55
int t, n, m;
char plaintext[2][LEN], ciphertext[2][LEN];
int h[2][26];
int main() {
scanf("%d", &t);
for (int i = 1; i <= t; i++) {
scanf("%d%d", &n, &m);
scanf("%s%s%s", plaintext[0], ciphertext[0], ciphertext[1]);
int shift = plaintext[0][0] - ciphertext[0][0]; //或者相反
for (int i = 0; i < m; i++) plaintext[1][i] = (ciphertext[1][i] - 'A' + shift + 26) % 26 + 'A';
plaintext[1][m] = '\0'; //多組cases
printf("Case #%d: %s\n", i, plaintext[1]);
}
return 0;
}
相關推薦
計蒜客之模擬篇
#include <stdio.h> #define LEN 55 int t, n, m; char plaintext[2][LEN], ciphertext[2][LEN]; i
計蒜客之貪心篇
//費用最大為:2e9; 貪心 #include <iostream> #include <algorithm> using namespace std; const int
[計蒜客NOIP模擬賽]2017.7.28Day1回顧反思總結
n) 模擬 查詢 同時 結點 reg etc mes 停止 D1T1 打地鼠 題目鏈接 反思- 比賽得分-0 思考: 比賽時,以為T1是一道常規模擬題目,沒怎麽看數據範圍。直接手動模擬,模擬完之後太自信也沒有造數據Hack自己的程序。直接導致爆0。同時發現自己對二
計蒜客NOIP模擬賽(3)D1T3 任性的國王
style tin print 變化 mes sin void n-2 下標 X 國的地圖可以被看作一個兩行 nn 列的網格狀圖。現在 X 國需要修建鐵路,然而該國的國王非常小氣,他只想保證位於某兩列之間的所有城市互相可以到達就行了,在此基礎上,他希望所花費的代價最小。 鐵
計蒜客NOIP模擬賽4 D2T2 跑步愛天天
數組 urn memset 我們 ng- int str 100% 序列 YOUSIKI 在 noip2016 的一道《天天愛跑步》的題爆零後,潛心研究樹上問題,成為了一代大師,於是皮皮妖為了測驗他,出了一道題,名曰《跑步愛天天》。 有一個以 1 為根的有根樹,初始每個點
羅馬數字轉換成整數--計蒜客-字串-模擬
給定一個羅馬數字 ss,將羅馬數字轉換成整數。 如羅馬數字I,II,III,IV,V分別代表數字 1, 2, 3, 4, 51,2,3,4,5。 首先要來了解一下羅馬數字表示法,基本字元有 77 個:I、V、X、L、C、D、M,分別表示 11
藍橋杯計蒜客之戀愛紀念日
#include <cstdio> int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; int main() { int y,m,d,k; scanf("%d%d%d%d",&y,&m,&d,&k);
計蒜客之蒜頭君的隨機數
#include <iostream> #include <cstdio> #include<algorithm> using namespace std; int a[105]; int b[105]; int main() { int n; int m;
計蒜客之蒜頭君學英語
#include<iostream> #include<cstdio> #include<stdlib.h> #include<cstring> #include<set> using namespace std; string word;
計蒜客之堆積木
#include<iostream> #include<cstdio> #include<stdlib.h> #include<vector> using namespace std; int main() { int n,m; cin>&g
演算法備戰之計蒜客之矩陣旋轉
#include<iostream> #include<stdlib.h> using namespace std; int main() { int m,n; cin>>n>>m; int a[n][m]; int b[m][n]; int
計蒜客2017.9.9 Day1 NOIP模擬賽
noip 計蒜客 滾動 不出 傳遞 概率題 線段 暴力 矩陣 火山噴發 概率題目就放在T1,真的好嗎? 廢話不說話,先寫10分的暴力程序。 正解待補 信息傳遞 我寫的floyd+dp(滾動數組優化空間) 50分 正解是 floyd+dp(矩陣快速冪優化)
計蒜客NOIP2017提高組模擬賽(四)day1
種類數 sca double 發的 ide %d ram 同時 需要 T1:小X的質數 小 X 是一位熱愛數學的男孩子,在茫茫的數字中,他對質數更有一種獨特的情感。小 X 認為,質數是一切自然數起源的地方。 在小 X 的認知裏,質數是除了本身和 1 以外,沒有其他因數的數
計蒜客 2017 NOIP 提高組模擬賽(四)Day1 T1 小X的質數 線性篩素數
範圍 線性篩 mat 需要 接下來 包含 能夠 數字 bottom 小 X 是一位熱愛數學的男孩子,在茫茫的數字中,他對質數更有一種獨特的情感。小 X 認為,質數是一切自然數起源的地方。 在小 X 的認知裏,質數是除了本身和 1 以外,沒有其他因數的數字。 但由於小 X
計蒜客NOIP2017提高組模擬賽(三)day2-小區劃分
ant abs set day2 name anti nan turn space 傳送門 dp,註意邊界 1 #include<cstdio> 2 #include<cstdlib> 3 #include<algorithm>
61計蒜客 動態規劃基礎 蒜頭君的城堡之旅
部分 pos include 路徑 entry 一個 空格 如果 size 蒜國地域是一個 n 行 m 列的矩陣,下標均從 1 開始。蒜國有個美麗的城堡,在坐標 (n,m) 上,蒜頭君在坐標 (1,1) 的位置上。蒜頭君打算出發去城堡遊玩,遊玩結束後返回到起點。在出
備戰演算法之計蒜客斐波那契數列
#include<iostream> #include<stdlib.h> using namespace std; int main() { int n; cin>>n; int a[100001]; a[0]=1; a[1]=1; for(int
計蒜客上藍橋杯模擬題的部分題解
<A> 思路:按照題意暴力就行了,答案是1. AC程式碼: #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxx = 1e5
計蒜客蒜頭君的城堡之旅
** 1.題目 ** 蒜國地域是一個 n 行 m 列的矩陣,下標均從 1 開始。蒜國有個美麗的城堡,在座標 (n,m) 上,蒜頭君在座標 (1,1) 的位置上。蒜頭君打算出發去城堡遊玩,遊玩結束後返回到起點。在出發去城堡的路上,蒜頭君只會選擇往下或者往右走,而在返回的路上,蒜頭君
計蒜客2018藍橋杯省賽B組模擬賽(一)題目及解析(未完待續)
一、題目列表 A. 結果填空:年齡 分值: 3 B. 結果填空:開關燈 分值: 7 C. 結果填空:U型數字 分值: 9 D. 程式碼填空:LIS 分值: 11 E. 程式碼填空:全排列 分值: 13 F. 結果填空:數獨