20级爪哇程序设计新生赛题解

  • 20级爪哇程序设计新生赛1.0(正式赛)
    • A.The Tree Of LittleZhua(思维或者线段树)
      • Easy Version
      • Hard Version
    • B.小爪的破译
    • C.小爪的博弈(巴什博弈)
    • D.小爪的乒乓球比赛(暴力或者数学计算)
    • E.小爪牌消消乐(区间DP)
    • F.小爪做安卓组考核(栈)
    • G.小爪的统计数据
    • H.小爪跳台阶
    • I.小爪的除数
    • J.小爪的数学题(前缀和)
    • K.小爪的试炼
    • L.小爪的荣耀(模拟)
  • 20级爪哇程序设计新生赛1.0(热身赛)
    • A.小爪学编程(水题)(热身赛)
    • B.小爪的座驾(热身赛)
    • C.小爪的AC(最长上升子序列)(热身赛)
    • D.小爪找规律(热身赛)

20级爪哇程序设计新生赛1.0(正式赛)

A.The Tree Of LittleZhua(思维或者线段树)

Easy Version

#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<algorithm>#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define int ll
#define INT_MAX 0x3f3f3f3f
#define INT_MIN 0xc0c0c0c0
using namespace std;
const int N = 200000;
int arr[N];
signed main()
{int n, m;scanf("%lld%lld", &n, &m);for(int i = 0; i < n; i++) scanf("%lld", &arr[i]);for(int i = 0; i < m; i++) {char ch;int a, b;getchar();scanf("%c%lld%lld", &ch, &a, &b);if (ch == 'Q') {int maxx = 0;for (int j = a - 1; j < b; j++) {if(arr[j] > maxx) maxx = arr[j];}printf("%lld\n", maxx);} else arr[a - 1] = b;}return 0;
}

Hard Version

线段树相关知识点原理及常见题型 Click here~~

#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<map>
#include<algorithm>#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
//#define int ll
#define INF 0x3f3f3f3f
using namespace std;
int read()
{int w = 1, s = 0;char ch = getchar();while (ch < '0' || ch>'9') { if (ch == '-') w = -1; ch = getchar(); }while (ch >= '0' && ch <= '9') { s = s * 10 + ch - '0';    ch = getchar(); }return s * w;
}
const int N = 200010;int m, p;//m操作次数,p取模的值是多少
struct Node{int l, r;//左端点,右端点int val;//区间[l, r]的最大值
}tr[N << 2];
int num[N];//由子节点的信息来计算父节点的信息
void pushup(int cur){tr[cur].val = max(tr[cur << 1].val, tr[cur << 1 | 1].val);
}//cur代表当前节点,
void build(int cur, int l, int r){//当前结点的左右儿子分别是tr[cur].l   tr[cur].rtr[cur] = {l, r};//如果已经是叶结点returnif(l == r) {tr[cur].val = num[r];return;}//否则求一下当前区间的中点int mid = l + r >> 1;//递归建立左边区间build(cur << 1, l, mid);//递归建立右边区间build(cur << 1 | 1, mid + 1, r);pushup(cur);
}//[l, r]查询区间   cur代表当前线段树里面的端点。
int query(int cur, int l, int r) {//①情况[TL,TR] ⊂ [L,R]//树中节点,已经被完全包含在[l, r]中了。if (tr[cur].l >= l && tr[cur].r <= r) {return tr[cur].val;}int mid = tr[cur].l + tr[cur].r >> 1;int val = 0;//判断与左边有没有交集if (l <= mid) {val = query(cur << 1, l, r);}//这里为什么是 r > mid,因为划分的区间是[l, mid][mid + 1, r],所以要用>而不能=//判断与右边有没有交集if (r > mid) {//为什么要取max?//因为上面先比较左值,所以左值可能有一个最大值,要跟再右边区间查询的值进行比较,取最大的。val = max(val, query(cur << 1 | 1, l, r));}//返回结果return val;
}//cur代表当前线段树里面的端点。tar代表要修改的位置
void modify(int cur, int tar, int val) {//如果当前节点就是叶节点,那么直接修改就可以了if (tr[cur].l == tar && tr[cur].r == tar) {tr[cur].val = val;return;}int mid = tr[cur].l + tr[cur].r >> 1;if (tar <= mid) {modify (cur << 1, tar, val);} else {modify (cur << 1 | 1, tar, val);}//递归完之后,要更新到父节点。//pushup就是更新父节点的信息pushup(cur);
}int main()
{int n,m;while(~scanf("%d%d",&n,&m)){memset(num, 0, sizeof num);memset(tr, 0, sizeof tr);for (int i = 1;i <= n; ++i) {scanf("%d", &num[i]);}build(1, 1, n);for (int i = 0; i < m; ++i) {char ch;int a, b;getchar();//每一次都要getchar();放在循环里面的第一行。scanf("%c%d%d",&ch,&a,&b);if (ch == 'Q') {printf("%d\n", query(1, a, b));}else{modify(1, a, b);}}}return 0;
}

B.小爪的破译

字符串b:

 a        b        b       a       c        c
b[1]     b[2]     b[3]    b[4]    b[5]     b[6]

字符串a:

 a      b      a     c
a[1]  a[2]   a[3]  a[4]

已知字符串b即已知字符串b的长度
通过观察得出规律:
两字符串之间的长度规律:b.length() = 2 × (a.length() - 1)
两字符串之间的数值规律:a[i] = b[2 × i - 1]

#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
int main()
{int t;scanf("%d", &t);getchar();while (t--) {char b[105];scanf("%s", b);for (int i = 0; i < strlen(b) - 1; i += 2) {printf("%c", b[i]);}printf("%c\n", b[strlen(b) - 1]);}return 0;
}

C.小爪的博弈(巴什博弈)

#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<algorithm>#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define int ll
#define INT_MAX 0x3f3f3f3f
#define INT_MIN 0xc0c0c0c0
using namespace std;
int read()
{int w = 1, s = 0;char ch = getchar();while (ch < '0' || ch>'9') { if (ch == '-') w = -1; ch = getchar(); }while (ch >= '0' && ch <= '9') { s = s * 10 + ch - '0';    ch = getchar(); }return s * w;
}
signed main()
{int t = read();while (t--) {int n = read();int m = read();if (n % (m + 1)) printf("first\n");else printf("second\n");}return 0;
}

D.小爪的乒乓球比赛(暴力或者数学计算)

暴力解法:

#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<map>
#include<algorithm>#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define int ll
#define INF 0x3f3f3f3f
#define PI acos(-1)
#define MOD 1e9 + 7
using namespace std;
int read()
{int w = 1, s = 0;char ch = getchar();while (ch < '0' || ch>'9') { if (ch == '-') w = -1; ch = getchar(); }while (ch >= '0' && ch <= '9') { s = s * 10 + ch - '0';ch = getchar(); }return s * w;
}
signed main()
{int t = read();while (t--) {int n = read();int cnt = 0;while (n > 1) {if (n % 2 == 0) {n /= 2;cnt += n;} else {n /= 2;cnt += n;n++;}}printf("%lld\n", cnt);}return 0;
}

数学解法:输出n-1就可以了
原理解析:
n支队伍参加淘汰赛决出获胜队伍需要场次是:n - 1

淘汰赛制:
那么有n支队伍,要决出获胜队伍,那么意思就是要淘汰 n - 1支队伍,一场比赛淘汰一支队伍,则需要n - 1场比赛。
如果需要争季军:就是需要n场比赛(加多一场季军赛)

#include<cstdio>
#include<iostream>
int main() {int t;scanf("%d", &t);while (t--) {int n;scanf("%d", &n);printf("%d\n", n - 1);}return 0;
}

E.小爪牌消消乐(区间DP)

区间DP的原理及例题 Click here ~

#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
int read()
{int w = 1, s = 0;char ch = getchar();while (ch < '0' || ch>'9') { if (ch == '-') w = -1; ch = getchar(); }while (ch >= '0' && ch <= '9') { s = s * 10 + ch - '0';ch = getchar(); }return s * w;
}
const int N = 410;//因为要开双链
const int inf = 0x3f3f3f3f;
int sum[N], val[N];//sum[N]表示合并付出的代价总和,val[N]表示每个点的值。
int dpmin[N][N], dpmax[N][N];//得分总和最小,得分总和最大
int main()
{int n = read();for (int i = 1; i <= n; ++i) {val[i] = read();val[i + n] = val[i];//化环形为链形}for (int i = 1; i <= n + n; ++i) {sum[i] = sum[i - 1] + val[i];//前缀和 以便最后求出——最后一步所需要付出的代价}//初始化memset(dpmin, 0x3f, sizeof dpmin);memset(dpmax, -0x3f, sizeof dpmax);//枚举链的长度for (int len = 1; len <= n; ++len) {//枚举区间左端点for (int l = 1; l + len - 1 <= n + n; ++l) {int r = l + len - 1;//区间右端点//如果区间长度为1,则无需付出任何代价。if (len == 1) dpmin[l][r] = dpmax[l][r] = 0;else {//枚举分界线for (int k = l; k < r; ++k) {dpmin[l][r] = min(dpmin[l][r], dpmin[l][k] + dpmin[k + 1][r] + sum[r] - sum[l - 1]);dpmax[l][r] = max(dpmax[l][r], dpmax[l][k] + dpmax[k + 1][r] + sum[r] - sum[l - 1]);}}}}//初始化最大值最小值。int maxv = -inf, minv = inf;for (int l = 1; l <= n; ++l) {maxv = max(maxv, dpmax[l][l + n - 1]);minv = min(minv, dpmin[l][l + n - 1]);}//得出结果printf("%d\n", minv);printf("%d\n", maxv);return 0;
}

F.小爪做安卓组考核(栈)

对数字运算进行模拟:
① 如果遇到 ’ + ’ 或 ’ - ',先将相应的数字push入栈(如果是 ’ - ’ 则push数字的相反数)
② 如果遇到优先级大的 ’ * ’ 或 ’ / ’ 先将相应数字与栈顶元素进行运算后将结果push进入
③ 最后将栈中所有元素相加。

#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<map>
#include<stack>
#include<algorithm>#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define int ll
#define INF 0x3f3f3f3f
#define PI acos(-1)
#define MOD 1e9 + 7
using namespace std;
int read()
{int w = 1, s = 0;char ch = getchar();while (ch < '0' || ch>'9') { if (ch == '-') w = -1; ch = getchar(); }while (ch >= '0' && ch <= '9') { s = s * 10 + ch - '0';ch = getchar(); }return s * w;
}
signed main()
{char c, s;char s;double n;//开头特殊处理:0 +'\n'时结束;while(~scanf("%lf%c",&n,&c)) {if(n == 0 && c=='\n') break;stack<double>stk;double ans=0;while(!stk.empty()) stk.pop();stk.push(n);while(~scanf("%c %lf",&s,&n)) {if (s == '+') stk.push(n);if (s == '-') stk.push(-n);if (s == '*') {double tmp = stk.top() * n;stk.pop();stk.push(tmp);}if (s=='/') {double tmp = stk.top() * 1.0 / n;stk.pop();stk.push(tmp);}c = getchar();if (c == '\n') break;}while (!stk.empty()) {ans += stk.top();st.pop();}printf("%.2lf\n",ans);}return 0;
}

G.小爪的统计数据

题解:用一个数组a[ ]进行计数,首先初始化a[ ]数组,全部为0
比如说:3 2 3 4 3 2 1, 算出其中最大的数字 maxx = max(maxx, a[i]); max()函数是比较两个数字大小;
如果是C语言的话需要自己写一个max()函数
int max (int n) {
if (a >= b) return a;
else return b;
}
遍历输入的数字然后依次执行
a[3]++;
a[2]++;
a[3]++;
a[4]++;
a[3]++;
a[2]++;
a[1]++;
此时最大的数字为4
然后从最大往最小遍历
for (int i = maxx; i >= 1; --i)
如果a[i] 不为 0,则输出 if (a[i])
注意输出格式。即可

#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<map>
#include<algorithm>#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define int ll
#define INF 0x3f3f3f3f
#define PI acos(-1)
#define MOD 1e9 + 7
using namespace std;
int read()
{int w = 1, s = 0;char ch = getchar();while (ch < '0' || ch>'9') { if (ch == '-') w = -1; ch = getchar(); }while (ch >= '0' && ch <= '9') { s = s * 10 + ch - '0';ch = getchar(); }return s * w;
}
const int N = 10010;
int a[N];
signed main() {int n = read();int maxx = 0;memset(a, 0, sizeof a);for (int i = 1; i <= n; ++i) {int x = read();a[x]++;maxx = max(maxx, x);}for (int i = maxx; i >= 1; --i) {if (a[i]) printf("%lld-%lld\n", i, a[i]);}return 0;
}

H.小爪跳台阶

题解:递推
f ( n ) = f ( n − 1 ) + f ( n − 2 ) f(n)=f(n-1)+f(n−2) f(n)=f(n−1)+f(n−2) 记得最后要 %1000000007

#include<iostream>
#include<cstdio>
const int N = 110;
int f[N];
int main()
{int n;scanf ("%d", &n);if (n == 1) printf("1\n");f[1] = 1;f[2] = 2;for (int i = 3; i <= n; i++) {f[i] = (f[i - 2] + f[i - 1]) % 1000000007;}printf("%d\n", f[n]);
}

I.小爪的除数

题解:要求最少次数,所以自然是先 % 的数字越大,操作数最少
所以依次从 5 到 3 再到 2;
注意数据范围很大要用 long long 定义变量

#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<algorithm>#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define int ll
#define INF 0x3f3f3f3f
using namespace std;
int read()
{int w = 1, s = 0;char ch = getchar();while (ch < '0' || ch>'9') { if (ch == '-') w = -1; ch = getchar(); }while (ch >= '0' && ch <= '9') { s = s * 10 + ch - '0';    ch = getchar(); }return s * w;
}
signed main()
{int n = read();while (n--) {int x = read(); int ans = 0;while (x > 1) {int flag = 0;if (x % 5 == 0) {x = x / 5 * 4;flag = 1;} else if(x % 3==0) {x= x / 3 * 2;flag = 1;} else if (x % 2 == 0) {x = x / 2;flag = 1;}ans++;if (!flag) break;}if (x == 1) printf("%lld\n",ans);else printf("-1\n");}return 0;
}

J.小爪的数学题(前缀和)

前缀和算法是一个必须要掌握的算法,详细解释Click here ~~

#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<map>
#include<algorithm>#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define int ll
#define INF 0x3f3f3f3f
#define PI acos(-1)
#define MOD 1e9 + 7
using namespace std;
int read()
{int w = 1, s = 0;char ch = getchar();while (ch < '0' || ch>'9') { if (ch == '-') w = -1; ch = getchar(); }while (ch >= '0' && ch <= '9') { s = s * 10 + ch - '0';ch = getchar(); }return s * w;
}
const int N = 1010;
int a[N];
int sum[N];
signed main() {int n = read();for (int i = 1; i <= n; ++i) {a[i] = read();sum[i] = sum[i - 1] + a[i];}int t = read();while(t--) {int l = read(), r = read();if (l > n) {printf("0\n");continue;}if (r > n) r = n;printf("%lld\n", sum[r] - sum[l - 1]);}return 0;
}

K.小爪的试炼

最长非回文字符串包括三种情况:
① 如果这整个字符串每个字符都一样,那么此时最长的非回文子串长度 == 0
② 如果这整个字符串是回文字符串,那么此时最长的非回文子串长度 == s.size()-1
③ 这整个字符串不是回文字符串,那么此时最长非回文子串长度 == s.size()

#include<cstdio>
#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<map>
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define INF 0x3f3f3f3f
using namespace std;
int read()
{int w = 1, s = 0;char ch = getchar();while (ch < '0' || ch>'9') { if (ch == '-') w = -1; ch = getchar(); }while (ch >= '0' && ch <= '9') { s = s * 10 + ch - '0';    ch = getchar(); }return s * w;
}
//------------------------ 以上是我常用模板与刷题几乎无关 ------------------------//
const int N = 50010;
string s;
signed main()
{cin >> s;int l = 0, r = s.size() - 1;char a = s[0];int flag = 1;while (l <= r) {if (s[l] != a || s[r] != a) flag = 0;if (s[l] == s[r]) l++, r--;else break;}if (l > r && flag) printf("0\n");//情况①else if (l > r) printf("%lld\n", s.size() - 1);//情况②else printf("%lld\n", s.size());//情况③return 0;
}

L.小爪的荣耀(模拟)

注意一下空格的输出方式

#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<map>
#include<algorithm>#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define int ll
#define INF 0x3f3f3f3f
#define PI acos(-1)
#define MOD 1e9 + 7
using namespace std;
int read()
{int w = 1, s = 0;char ch = getchar();while (ch < '0' || ch>'9') { if (ch == '-') w = -1; ch = getchar(); }while (ch >= '0' && ch <= '9') { s = s * 10 + ch - '0';ch = getchar(); }return s * w;
}
//最大公约数
int gcd(int x,int y) {if(x<y) swap(x,y);//很多人会遗忘,大数在前小数在后//递归终止条件千万不要漏了,辗转相除法return x % y ? gcd(y, x % y) : y;
}
//计算x和y的最小公倍数
int lcm(int x,int y) {return x * y / gcd(x, y);//使用公式
}
int ksm(int a, int b, int mod) { int s = 1; while(b) {if(b&1) s=s*a%mod;a=a*a%mod;b>>=1;}return s;}
//------------------------ 以上是我常用模板与刷题几乎无关 ------------------------//
signed main() {int n = read();int kase = 1;for (int i = 1; i <= n; ++i) {for (int j = 1; j <= n + n; ++j) {if (i == j) printf("V");else if (j == n + n - kase) {printf("V");kase++;}else printf(" ");}printf("\n");}return 0;
}

20级爪哇程序设计新生赛1.0(热身赛)

A.小爪学编程(水题)(热身赛)

#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<map>
#include<algorithm>#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define int ll
#define INF 0x3f3f3f3f
#define PI acos(-1)
#define MOD 1e9 + 7
using namespace std;
int read()
{int w = 1, s = 0;char ch = getchar();while (ch < '0' || ch>'9') { if (ch == '-') w = -1; ch = getchar(); }while (ch >= '0' && ch <= '9') { s = s * 10 + ch - '0';ch = getchar(); }return s * w;
}
const int N = 200010;
signed main() {int h1 = read(), m1 = read(), h2 = read(), m2 = read();int h3 = 0, m3 = 0;h3 = h2 - h1;if (m1 > m2) {h3--;m3 = 60 - m1 + m2;} else {m3 = m2 - m1;}printf("%lld %lld\n", h3, m3);return 0;
}

B.小爪的座驾(热身赛)

题解:简单的去重和排序

C++做法的STL sort()和unique()这两个函数,就是这么简单

#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{int n;scanf("%lld", &n);int a[1010];for (int i = 0; i < n; i++)  scanf("%lld", &a[i]);sort(a, a + n);int len = unique(a, a + n) - a;//去重,并返回去重后的长度 printf("%lld\n", len);//输出去重后的长度 for (int i = 0; i < len; i++) printf("%lld ",a[i]); printf("\n");return 0;
}

C语言做法:就要自己手写两个函数,第一个是排序,第二个去重。

#include<stdio.h>
int main()
{int n;int a[1010];int b[1010];int i, j, t;int cnt;scanf("%d", &n); for (i = 1; i <= n; i++) scanf("%d", &a[i]); //排序 可以用C++ 的STL sort()函数代替 for (i = 1; i <= n; i++) {for (j = i + 1; j <= n; j++) {if (a[i] > a[j]) {t = a[i];a[i] = a[j];a[j] = t;}}}//去重 可以用C++ 的STL unique()函数代替 cnt = 0;for (i = 1; i <= n; i++) {if (a[i] != a[i + 1]) {cnt++;b[cnt] = a[i];    }}printf("%d\n", cnt);for (i = 1; i <= cnt; i++) printf("%d ",b[i]);return 0;
}

C.小爪的AC(最长上升子序列)(热身赛)

遍历
如果递增就cnt++,同时存一个最大值maxx
如果下一个cnt比这个最大值maxx大,那么就替换

#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<map>
#include<algorithm>#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define int ll
#define INF 0x3f3f3f3f
#define PI acos(-1)
#define MOD 1e9 + 7
using namespace std;
int read()
{int w = 1, s = 0;char ch = getchar();while (ch < '0' || ch>'9') { if (ch == '-') w = -1; ch = getchar(); }while (ch >= '0' && ch <= '9') { s = s * 10 + ch - '0';ch = getchar(); }return s * w;
}
signed main(){  int n = read();int ans = 1, cnt = 1;int pre = read();n--;while (n--) {int cur = read();if (pre < cur) cnt++;else cnt = 1;ans = max(ans, cnt);pre = cur;}printf("%lld\n", ans);return 0;
}

D.小爪找规律(热身赛)

题解:
杨辉三角,有个小坑,注意一下每一行最后不能有空格
a [ i ] [ j ] = a [ i − 1 ] [ j − 1 ] + a [ i − 1 ] [ j ] a[i][j]=a[i-1][j-1]+a[i-1][j] a[i][j]=a[i−1][j−1]+a[i−1][j]

#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<map>
#include<algorithm>#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define int ll
#define INF 0x3f3f3f3f
#define PI acos(-1)
#define MOD 1e9 + 7
using namespace std;
int read()
{int w = 1, s = 0;char ch = getchar();while (ch < '0' || ch>'9') { if (ch == '-') w = -1; ch = getchar(); }while (ch >= '0' && ch <= '9') { s = s * 10 + ch - '0';ch = getchar(); }return s * w;
}
int a[25][25];
signed main()
{int n = read();for (int i = 1; i <= n; i++) a[i][1] = a[i][i] = 1;for (int i = 1; i <= n; i++) {for (int j = 2; j < i; j++) {a[i][j] = a[i - 1][j] + a[i - 1][j - 1];}}for (int i = 1; i <= n; i++) {printf("%lld", a[i][1]);for (int j = 2; j <= i; j++) {printf(" %lld", a[i][j]);}printf("\n");}return 0;
}

20级爪哇程序设计新生赛(一)题解相关推荐

  1. 21级爪哇程序设计新生赛(二)题解

    21级爪哇程序设计新生赛(二) 序 A 小爪的数字集合(并查集) B 小爪的得分(博弈) C 小爪的博弈(博弈) D ljc和cyj玩五子棋(模拟) E ljc和雪球(模拟) F LJC的背包(动态规 ...

  2. 19级爪哇程序设计新手赛(题解)

    19级爪哇程序设计新手赛(题解) A.1+1 HDU - 1228 kk的英语作业,有两个小于100的正整数A和B,计算A+B. A和B由对应的英文单词给出. Input 测试输入包含若干测试用例,每 ...

  3. 19级爪哇程序设计新手赛2.0(参考题解)

    看完它 A - Candies CodeForces - 1343A 题意: (1)玄学观察法,咋们先来看看案例: 3 --> 1 除以3==2^2-1 6 --> 2 除以3 7 --& ...

  4. 第十二届西南石油大学程序设计新生赛官方题解

    整理的算法模板合集: ACM模板 目录 A.杰杰国王的平等节(easy)[签到] B.最佳复习效果(easy - mid)[二分查找] C.无限之路(mid - hard)[离散化+前缀和] D.Is ...

  5. 2021暨南大学轩辕杯ACM程序设计新生赛题解

    title : 2021暨南大学轩辕杯ACM程序设计新生赛 date : 2021-12-12 tags : ACM,练习记录 author : Linno 题目链接:https://ac.nowco ...

  6. ACM新生赛部分题解

    2021级的ACM新生赛已经完结了,我就自己做出来的八道题整理一下题解,因为其他是真的不会. 链接:登录-专业IT笔试面试备考平台_牛客网 来源:牛客网 一.我们是冠军 7 日星期 777 的凌晨,7 ...

  7. 南邮2014程序设计新生赛暨蓝桥杯校内自主选拔赛

    南邮2014程序设计新生赛暨蓝桥杯校内自主选拔赛 题目链接:  http://acm.njupt.edu.cn/acmhome/contest.do?&method=contestDetail ...

  8. 2019燕山大学程序设计新生赛(二)

    2019燕山大学程序设计新生赛(二) 绝地武士 参考代码 织梦岛 参考代码 谍战风云 参考代码 绝地武士 天赋异禀的绝地武士安纳金·天行者受西斯大帝达斯·西迪厄斯蛊惑,堕入原力黑暗面,随后被派去绝地圣 ...

  9. 2023年福建农林大学程序设计校赛个人题解(无D解析)

    2023年福建农林大学程序设计校赛个人题解(无D解析) A-这是一道原题 问题解析 从绿色材料合成到金色材料. 用 w h i l e while while 循环判断材料数是否能合成,能就合,合成后 ...

最新文章

  1. node、Mongo项目如何前后端分离提供接口给前端
  2. 被迫重构代码,这次我干掉了 if-else
  3. 推荐8个令人骄傲的国产软件,改变你对国产的认知
  4. stateflow中向量与矩阵
  5. halcon write_ocr_class_svm 将OCR分类器写入文件
  6. CSS- 横向和纵向时间轴
  7. php文件缓存代码,php文件缓存实例代码
  8. Covariance and Contravariance in C#, Part One
  9. 信息学奥赛C++语言: 计算两个数的最小公倍数
  10. Redis集群之哨兵模式
  11. 励志生活-英国式选秀带来的启示
  12. Java垃圾回收机制详解(万字总结!一篇入魂!)
  13. 《IBM SPSS Modeler数据与文本挖掘实战》之社交网络分析
  14. linux 系统下的压力测试工具LTP和stress区别
  15. 惠普局域网共享打印机设置_Windows7局域网共享打印机教程,HP M1136 MFP打印机共享方法...
  16. iTween_itween可视化编辑器(1)
  17. 东莞女德班被责令停办 学员被遣散并退回学费
  18. 散列表查找——线性探测法
  19. 使用jcrop实现裁切图片
  20. js购物车功能php,使用JS实现购物车功能步骤详解

热门文章

  1. openmpi参数_MPI初学-安装及OpenMPI函数说明
  2. 身份账户体系结构(Identity Account Architecture)
  3. python微信小程序爬虫_Python爬取微信小程序实战(通用)
  4. vue 在结合 vant 写移动端时上传图片之前,压缩图片大小
  5. windows 10 系统重装
  6. 使用(telemetry)ceilometer+gnocchi对openstack云平台监控数据采集和处理的实践与优化
  7. 舆情监控服务方案,TOOM舆情监控服务内容有哪些?
  8. 浅谈陀螺仪和加速度计的互补滤波
  9. JAVA集合1(Collection接口,iterator()方法,增强型for循环)
  10. OpenCV:Canny算子边缘检测