本文主要是介绍H - Hash Code Hacker Gym - 100801H,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
题意:
构造 k k k个相同哈希值的字符串
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <map>using namespace std;typedef long long ll;const int maxn = 1e5 + 7;int main() {freopen("hash.in","r",stdin);freopen("hash.out","w",stdout);int n;scanf("%d",&n);for(int i = 1;i <= n;i++) {for(int j = 1;j <= 1000;j++) {if(j == i - 1 && i != 1) {printf("%c",'G' - 1);}else if(j == i && i != 1) {printf("%c",'G' + 31);}else {printf("G");}}printf("\n");}return 0;
}
这篇关于H - Hash Code Hacker Gym - 100801H的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!