摘要:
题目描述:一个数组a,输入一个数,找到这个数在数组中的位置,将其下标+1再输出 include<bits/stdc++.h> using namespace std; int n; int a[1000000]; int x; int pos=-1; int main() { cin>>n; int 阅读全文
posted @ 2025-08-02 20:56
暗神酱
阅读(5)
评论(0)
推荐(0)
问题仍然是昨天的问题,今天又花了一个小时左右自己重写了一遍: include<bits/stdc++.h> void swapa(int &a,int & b) { int temp=a; a=b; b=temp; } void qp(int start,int a[],int n) { if(st 阅读全文
这个是前两天搞的那个深度优先算法的进阶版本: 问题描述已经在下面了,接下来是实现代码: //回溯算法 通常是与深度优先搜索算法绑定的算法 int n=0; bool mark[6][6]; int path[26][3]; int pathcount=0; int dx[5]={0,0,1,0,-1 阅读全文
下图输入样例: 4 1 2 0 2 1 3 1 1 1 4 0 0 2 3 2 0 2 4 4 0 3 4 2 2 输出样例: 2 3 1 4 代码示例: struct competition { int num1; int num2; int num1score; int num2score; } 阅读全文