ICode9

精准搜索请尝试: 精确搜索
  • 1048 游戏 sg函数变式 博弈论2022-07-30 22:00:12

    链接:https://ac.nowcoder.com/acm/contest/26656/1048来源:牛客网 题目描述 小N和小O在玩游戏。他们面前放了n堆石子,第i堆石子一开始有ci颗石头。他们轮流从某堆石子中取石子,不能不取。最后无法操作的人就输了这个游戏。但他们觉得这样玩太无聊了,更新了一

  • 1048 [NOIP2007]守望者的逃离 线性DP 贪心 无后效性2022-07-21 03:31:07

    链接:https://ac.nowcoder.com/acm/contest/24213/1048来源:牛客网 题目描述 恶魔猎手尤迪安野心勃勃,他背叛了暗夜精灵,率领深藏在海底的娜迦族企图叛变。守望者在与尤迪安的交锋中遭遇了围杀,被困在一个荒芜的大岛上。为了杀死守望者,尤迪安开始对这个荒岛施

  • #1048 Longest String Chain2022-03-01 10:59:06

    Description You are given an array of words where each word consists of lowercase English letters. wordA is a predecessor of wordB if and only if we can insert exactly one letter anywhere in wordA without changing the order of the other characters to mak

  • PAT 1048 Find Coins (25 分) map or Hash散列2022-02-10 12:00:28

    #include<iostream> #include<map> using namespace std; int main(){ int n,m,temp; cin>>n>>m; map<int,int>mapp; for(int i=0;i<n;i++){ scanf("%d",&temp); mapp[temp]++;

  • PAT-1048 Find Coins2022-02-09 21:06:59

    1048 Find Coins part 2, 2.0 自己解法(未全对) 2 WA 3,4 TO 可恶,直接用find太慢了 #include <iostream> using namespace std; #include <vector> #include <algorithm> int main() { int N, M; cin >> N >> M; int V1, V2; vector<

  • PAT (Basic Level) Practice 1048 数字加密 (20 分)2022-02-02 18:34:44

    题目:1048 数字加密 (20 分) 来源:PAT (Basic Level) Practice 传送门 1048 数字加密 题面 题意:给定两个数字A,B,按给定规律对奇偶位分别操作。 思路:建议字符串输入,如果一个字符串长度小于另一个的话,前面要用零补上。 Code 点击查看代码 #include <iostream> #include <stri

  • 1048. 最长字符串链2022-01-10 11:34:21

    给出一个单词列表,其中每个单词都由小写英文字母组成。 如果我们可以在 word1 的任何地方添加一个字母使其变成 word2,那么我们认为 word1 是 word2 的前身。例如,"abc" 是 "abac" 的前身。 词链是单词 [word_1, word_2, ..., word_k] 组成的序列,k >= 1,其中 word_1 是

  • 1048 数字加密 (20 分) javascript2021-11-30 17:01:09

    本题要求实现一种数字加密方法。首先固定一个加密用正整数 A,对任一正整数 B,将其每 1 位数字与 A 的对应位置上的数字进行以下运算:对奇数位,对应位的数字相加后对 13 取余——这里用 J 代表 10、Q 代表 11、K 代表 12;对偶数位,用 B 的数字减去 A 的数字,若结果为负数,则再加 10。

  • 1048 数字加密 (20 分)2021-11-21 12:58:18

    1048 数字加密 (20 分) 题目链接 算法分析 由于数字可能会超过一百位,所以我们选择用字符串来读入。 然后把各位数字存到一个整形数组中,之后再对每一位进行分类讨论并计算。 代码实现 #include<bits/stdc++.h> using namespace std; #define N 110 char s[N] = {'0', '1', '2'

  • java.sql.SQLIntegrityConstraintViolationException: Unknown error 10482021-10-09 09:34:15

    添加数据时候报错 原因: Integrity Constraint (完整性约束) 违反违反唯一约束条件,查看测试库的数据时,发现插入数据具有唯一约束条件的列值有重复。 问题解决: 去掉重复列数据信息,就可以正常编译运行了。 我把画红框的非空约束去掉就可以了。。

  • 1048 Find Coins (25 分)并未AC2021-10-04 21:30:46

    1048 Find Coins (25 分)并未AC Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However, there was a special req

  • tiktokOA 1048. Longest String Chain2021-10-03 13:33:53

    自己写的,超时 class Solution { public: int longestStrChain(vector<string>& words) { int maxn = 1; for(int i = 0; i < words.size(); i++){ maxn = max(maxn, dfs(words[i],words)); } return maxn; }

  • 1048 数字加密 (20 分)2021-09-27 12:59:24

    本题要求实现一种数字加密方法。首先固定一个加密用正整数 A,对任一正整数 B,将其每 1 位数字与 A 的对应位置上的数字进行以下运算:对奇数位,对应位的数字相加后对 13 取余——这里用 J 代表 10、Q 代表 11、K 代表 12;对偶数位,用 B 的数字减去 A 的数字,若结果为负数,则再加 10。这里

  • 算法 || 洛谷 1048 采药 动态规划 c语言2021-09-22 17:30:29

    题目链接 #include <stdio.h> long long max (long long a, long long int b) { return (a > b) ? a : b; } int main() { int t, m; scanf("%d%d", &t, &m); long long b [101][1001] = {0}; int time[1001], value[101];

  • [PAT][Basic Level]10482021-06-08 21:30:43

    NOT AC CODE:` ``cpp #include #include #include #include using namespace std; #define M 100+1 int main() { char strA[M]; char strB[M]; char str_output[M+10]; cin>>strA>>strB; char to_char[13]={‘0’,‘1’,‘2’,‘3’,‘4’,‘5’,‘6’,‘7’,‘8’,‘9

  • PTA basic 1048 数字加密 (20 分) c++语言实现(g++)2021-05-07 23:32:30

    本题要求实现一种数字加密方法。首先固定一个加密用正整数 A,对任一正整数 B,将其每 1 位数字与 A 的对应位置上的数字进行以下运算:对奇数位,对应位的数字相加后对 13 取余——这里用 J 代表 10、Q 代表 11、K 代表 12;对偶数位,用 B 的数字减去 A 的数字,若结果为负数,则再加 10。这里令

  • PAT乙级_1048 数字加密 (20 分)_python2021-03-08 17:02:09

    题目: 本题要求实现一种数字加密方法。首先固定一个加密用正整数 A,对任一正整数 B,将其每 1 位数字与 A 的对应位置上的数字进行以下运算:对奇数位,对应位的数字相加后对 13 取余——这里用 J 代表 10、Q 代表 11、K 代表 12;对偶数位,用 B 的数字减去 A 的数字,若结果为负数,则再加

  • C++版浙大PAT乙级1048(20分)测试点2、测试点5答案错误解决办法2021-02-27 20:33:58

    https://pintia.cn/problem-sets/994805260223102976/problems/994805276438282240  百度之后,发现测试点2、5就是在A的位数大于B的位数的情况,B前面要添加‘0’再进行加密。 #include<iostream> using namespace std; int main() { string a, b; cin >> a >> b;

  • 1048 数字加密 (20 分)2021-02-13 20:02:30

    对AB的长度不一致处理时不能用swap()函数,必须分情况单独处理,因为偶数位要求用B的数字减去A的数字,交换AB会导致减法次序错误。 string a,b; char mp[]={'J','Q','K'}; char trans(int x) { if(x<10) return '0'+x; else return mp[x-10]; } int main() { cin>>a&

  • 1048 最长字符串链2021-01-12 22:01:25

    题目描述: 给出一个单词列表,其中每个单词都由小写英文字母组成。 如果我们可以在 word1 的任何地方添加一个字母使其变成 word2,那么我们认为 word1 是 word2 的前身。例如,“abc” 是 “abac” 的前身。 词链是单词 [word_1, word_2, …, word_k] 组成的序列,k >= 1,其中 word_1

  • PAT 乙级 1048 数字加密 (20分)2020-11-27 19:33:29

    #include<iostream> #include<string> #include<algorithm> using namespace std; int main() { string a, b; cin >> a >> b; string result; while (a.length() != b.length()) { if (a.length() > b.length()) b = '0&#

  • HDU--1048--字符串处理2020-03-01 11:01:56

    Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself alive. In order for him to survive, he decided to create one of the first ciphers. This cipher was so incredibly sound, that no one could fig

  • HDU-1048,The Hardest Problem Ever(字符串处理)2020-01-20 15:07:31

    Problem Description: Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself alive. In order for him to survive, he decided to create one of the first ciphers. This cipher was so incredibly sound,

  • 1046--1048 题参考代码2019-11-06 20:01:43

    1046: 整型数据类型存储空间大小 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 int main() 5 { int a; 6 cout<<sizeof(a)<<endl; 7 return 0; 8 } 1047: 浮点型数据类型存储空间大小 1 #include <bits/stdc++.h> 2 using namespace std; 3 int m

  • LeetCode 1048. Longest String Chain2019-10-28 09:03:15

    原题链接在这里:https://leetcode.com/problems/longest-string-chain/ 题目: Given a list of words, each word consists of English lowercase letters. Let's say word1 is a predecessor of word2 if and only if we can add exactly one letter anywhere in word1 to ma

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有