2023年冬季周赛(三)
1 找最大值1234567891011#include <stdio.h>int main() { int mx = 0; for (int i = 0; i < 4; i++) { int x; scanf("%d", &x); mx = mx > x ? mx : x; } printf("%d\n", mx);} 2 二三得六12345678910111213141516171819202122232425#include <stdio.h>int main() { int n, m; scanf("%d %d", &n, &m); int d = m / n; if (m % n != 0) { printf("-1\n"); return 0; } ...
2023年冬季周赛(二)
2 a+b?1234567891011121314151617181920212223242526272829#include <stdio.h>#include <string.h>int a[1000005], b[1000005], ans[1000005];char s[1000005], t[1000005];int max(int a, int b) { return a > b ? a : b; }int main() { scanf("%s", s); scanf("%s", t); int len1 = strlen(s), len2 = strlen(t); for (int i = len1 - 1, j = 0; i >= 0; i--, j++) { a[j] = s[i] - '0'; } for (int i = len2 - 1, j = 0; i >= ...
2023年冬季周赛(一)
12345678#include <stdio.h>int main() { printf("\\ /\n"); printf(" \\/\n"); printf(" /\\\n"); printf("/ \\\n"); return 0;} 2 学号1234567#include<stdio.h>int main () { char s[20]; scanf("%s", s); printf("20%c%c", s[0], s[1]); return 0;} 3 平均数12345678910111213141516#include <bits/stdc++.h>using namespace std;int main() { double a, b, c, d, n, z; cin >> a &g ...
软件开发协会的挑战书
在RSA密码体系中, 欧几里得算法是加密或解密运算的重要组成部分。它的基本运算过程就是解 $ax\equiv 1\pmod n$ 这种方程。整个解的过程是这样的,我们用一个例子来说明。 当 a = 1001 ,n = 3837 时,方程为 x * 1001 ≡ 1 (mod 3837)我们有3837 = 3 * 1001 + 8341001 = 1 * 834 + 167 834 = 4 * 167 + 166 167 = 1 * 166 + 1 所以 1 = 167 + (–1) * 166 = 167 - (834 - 4 * 167) = -1 * 834 + 5 * 167 = 5 *(1001 - 834) – 834 = 5 * 1001 + (-6) * 834 = 5 * 1001 - 6 * (3837 -3 * 1001) = -6 * 3837 + 23 * 1001 然后对等式两端同时模 3837 得 23 * 1001 ...