您的位置:首页 > 娱乐 > 八卦 > 微信里的小程序在哪_建站公司山东济南兴田德润简介_seo测试工具_白嫖永久服务器

微信里的小程序在哪_建站公司山东济南兴田德润简介_seo测试工具_白嫖永久服务器

2025/4/8 0:06:02 来源:https://blog.csdn.net/weixin_60762640/article/details/143301281  浏览:    关键词:微信里的小程序在哪_建站公司山东济南兴田德润简介_seo测试工具_白嫖永久服务器
微信里的小程序在哪_建站公司山东济南兴田德润简介_seo测试工具_白嫖永久服务器

1、图像旋转

题目链接:https://sim.csp.thusaac.com/contest/4/problem/0

100分代码:

#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{int n,m;cin >> n >> m;int a[1010][1010];for(int i = 0; i < n; i++){for(int j = 0; j < m; j++){cin >> a[i][j];}}for(int i = m-1; i >= 0; i--){for(int j = 0; j < n; j++){cout << a[j][i] << " ";}cout << endl;}return 0;
}

评测结果:

2、数字排序

题目链接:https://sim.csp.thusaac.com/contest/4/problem/1

100分代码:

#include <iostream>
#include <algorithm>
using namespace std;
bool cmp(int a, int b){return a > b;
}int main(int argc, char *argv[])
{int n;cin >> n;int a[1010],A[1010],b[1010],cnt[1010] = {0};int k = 0;int ans;for(int i = 0; i < n; i++){cin >> a[i];cnt[a[i]]++;if(cnt[a[i]] == 1){A[k] = a[i];k++;}} sort(A , A + k);int t = 0;for(int i = 0; i < 1010; i++){if(cnt[i] > 0 && cnt[i] <= n){b[t] = cnt[i];t++;}}sort(b , b + t, cmp);bool flag[1010];for(int i = 0; i < t; i++){for(int j = 0; j < k; j++){if(cnt[A[j]] == b[i] && flag[A[j]] == false){cout << A[j] << " " << b[i] << endl;flag[A[j]] = true;break;}}}return 0;
}

评测结果:

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com