ICode9

精准搜索请尝试: 精确搜索
  • 选择排序2020-12-15 20:35:58

    include<stdio.h> include<stdlib.h> include<time.h> void sort2(int* q); int main() { int a[10],*q,i, n; srand(time(0)); for (i = 0; i < 10; i++) a[i] = rand() % 100; printf("a~before---"); for (n = 0; n < 10; n++) { pr

  • exp+52020-12-15 20:33:20

    实验一   # include<stdio.h> const int N=3; int main(){ int a[N]={1,2,3}; int i; printf("通过数组名及下标直接访问数组元素:\n"); for(i=0;i<N;i++) printf("%d:%d\n",&a[i],a[i]); printf("通过地址间接访问数组元素;\n&

  • 冒泡排序2020-12-15 20:03:13

    include<stdio.h> include<stdlib.h> include<time.h> void sort1(int* p); int main() { int a[10],* p,i, n; srand(time(0)); for (i = 0; i < 10; i++) { a[i] = rand() % 100; } printf("a~before---"); for (n = 0; n < 10; n++) {

  • 300【毕设课设】基于51单片机的光控路灯设计(光敏)2020-12-15 16:01:37

    【资源下载】下载地址如下:https://docs.qq.com/doc/DTlRSd01BZXNpRUxl 本设计由STC89C52单片机电路+光敏电阻模块+4位高亮LED灯模块+电源电路组成。 1、白天灯不亮,晚上灯亮。 2、光照的阈值可以通过光敏电阻模块上的电位器调节。 点击并拖拽以移动​ #include<reg52.h> //包含

  • 【LibreOJ101】模板:最大流2020-12-15 14:33:46

    LibreOJ https://loj.ac/p/101 #include<cstdio> #include<algorithm> #include<cstdlib> #include<cstring> #include<iostream> #include<cctype> #include<cmath> using namespace std; #define add_edge(a,b,c) ++tot,nxt[to

  • CodeForces - 1272E Nearest Opposite Parity(多源起点的最短路)2020-12-15 12:57:34

    题目链接:点击查看 题目大意:给出 n 个点,每个点都有一个权值 a[ i ],且每个点可以到达 ( i - a[ i ] ) 和 ( i + a[ i ] ) 两个位置,花费为 1,问每个点到达与其本身奇偶不同的点的最小花费是多少 题目分析:看到网上那么多假算法的题解真的人傻了,写了个 spfa 恩说是 bfs ,不过这题好像

  • 快速排序(递归方式)2020-12-15 12:33:49

    快速排序(递归方式) //因为最近时间问题,该博客待完善 快速排序,时间复杂度:理想的情况是,每次划分所选择的中间数恰好将当前序列几乎等分,经过log2n趟划分(一次划分算法从两头交替搜索,直到low和hight重合,因此一次划分算法的时间复杂度是O(n);),整个算法的时间复杂度为O(nlog2n)

  • PAT(甲级)1028 List Sorting(排序)2020-12-15 12:32:02

    Description: 题目大意:给出 n 个学生的ID,name,grade。 C = 1,按照 ID 升序排序。C = 2,按照 name 升序排序,如果名字相同,按照 ID 升序排序。C = 3,按照 grade 升序排序,如果 grade 相同,按照 ID 升序排序。 解题思路: 算法标签:排序 代码: // TSWorld #include <iostream> #include

  • C.罚时计算2020-12-15 10:02:15

    C.罚时计算 #include<stdio.h> int main() { int n, a, b, c, d = 0; scanf("%d", &n); for (int i = 1; i <= n; i++) { scanf("%d%d%d", &a, &b, &c); if (a == 0) { d = d + 0;

  • [P2602] [ZJOI2010]数字计数(数位dp)2020-12-15 09:35:15

    原题 题目描述 给定两个正整数 \(a\) 和 \(b\),求在 \([a,b]\) 中的所有整数中,每个数码(digit)各出现了多少次。 输入格式 仅包含一行两个整数 \(a,b\),含义如上所述。 输出格式 包含一行十个整数,分别表示 \(0∼9\)在 \([a,b]\)中出现了多少次。 输入输出样例 输入 #1 1 99 输出 #1

  • 基于IIC实现温湿度采集2020-12-14 22:32:21

    基于IIC并且使用AHT20温湿度传感器实现温湿度采集 1 什么是IIC1.1 IIC简介1.2 软件IIC和硬件IIC 2 AHT20温湿度传感器2.1 AHT20简介2.2 AHT20引脚图与电路图2.3 传感器与STM32板子相连 3 实现温湿度采集3.1 代码编写3.2 烧录结果 4 总结 1 什么是IIC 1.1 IIC简介 IIC(Inte

  • 快速排序2020-12-14 22:01:32

    1 //快速排序 2 #include<iostream> 3 #include <algorithm> 4 using namespace std; 5 int kuaipai1(int r[], int first, int end) 6 { 7 int i = first; 8 int j = end; 9 while (i<j) 10 { 11 while (i<j&&r[i]&l

  • 牛客挑战赛46 D2020-12-14 21:02:25

    include include include include include include include include include include include include //#include include include include<unordered_map> pragma GCC diagnostic error "-std=c++11" pragma GCC optimize("-fdelete-null-pointer-che

  • Gym102875H Happy Morse Code(DP)2020-12-14 21:00:07

    Gym102875H Happy Morse Code(DP) Description Little Rabbit and Little Horse recently learned about Morse code and found that just only two symbols of dash and dot can express countless words, for that each letter has a unique dash-dot string correspondence

  • 实验52020-12-14 20:33:53

    实验1 #include <stdio.h> const int N=3; int main() { int a[N] = {1, 2, 3}; int i; printf("通过数组名及下标直接访问数组元素:\n"); for(i=0; i<N; i++) printf("%d: %d\n", &a[i], a[i]); printf(&qu

  • MFC基础--CString的Tokenize()和_tcstok()的用法对比2020-12-14 19:59:03

         Tokenize()和_tcstok()都是用来分割字符串的方法。但是其各自的使用还是有很多不同。      下面对字符串“%s111gdfafd%s\t023232%s\t1%s\t2%s\t3%s\t4%s\t0XFF0000%s\tfdas”用这两个函数都进行一些相同匹配分割处理,代码和结果对比如下:     Tokenize():

  • 实验五2020-12-14 17:36:23

    任务一 #include <stdio.h> const int N=3; int main() { int a[N] = {1, 2, 3}; int i; printf("通过数组名及下标直接访问数组元素:\n"); for(i=0; i<N; i++) printf("%d: %d\n", &a[i], a[i]); printf("通过地址间接访问数组元素:\n"); f

  • # 牛客挑战赛46 B最小的指数2020-12-14 16:02:43

    牛客挑战赛46 B最小的指数 传送门 题意:1e6次询问,每次给你一个1e18的数问你质因数分解后的所有质因数中的指数幂中最小的是多少。 题解:将4000以下的素数预处理,然后分解n,若剩余值等于1说明已完全分解,若大于1,也易知其剩余最小质因数指数幂不超过4,便如下分类讨论。 1.若为4,则必为x^4==

  • c代码利用ndk-build来生成elf可执行文件2020-12-14 15:29:11

    原文章地址:https://www.ssfiction.com/category/andiordadb--猴子技术宅 当然这个是我们在实践中,在cmd窗口中能看到文件生成流程,让我们知道ndk-build生成elf可执行文件原理:对于后期在破解中更能得到启发; 写一个简单的冒泡算法:(结尾:.c结尾)maopao.c #include "stdio.h" #include "

  • 题目集 超级数字2020-12-14 12:04:24

    7-11 小明的超级数字 (60分) 小明最近一段时间爱上了数学,他太喜欢数学了,以至于经常给数字取名字。今天天气很好,他突然有了一个想法,将既是回文数又是质数的数字叫做超级数字。但是他却不知道要如何判断和找出这些数字,因此他找到了奇奇哥,奇奇哥很热心的帮助他解决问题,并且给你

  • Sage's Birthday (hard version)2020-12-14 12:03:06

    https://codeforces.com/contest/1419/problem/D2 做法: 可以先给数组排个顺序(从大到小),然后选择后(n/2+1)个元素插到前面的大数字之前, 一个样例: 6 2 2 2 2 2 1 输出 1 2 2 2 1 2 2 写了很久这个脑残题,很难过。。。。     #include<iostream> #include<cstring> #include<queu

  • CF1461C 【Random Events】题解2020-12-14 11:01:50

    首先,从后往前扫,找出第一个\(a_i\neq i\)的位置,记为\(st\) 从前往后扫,对于\(r_i<st\)的,选不选都没关系。 对于\(r_i\ge st\)的,至少有一个成功排序就会使整个序列被排序 考虑容斥,用所有情况减去\(r_i\ge st\)一个都不选的情况即可 即\(ans = 1-\prod\limits_{r_i\ge st} {1-p_i}\)

  • C++ -string method - find, replace, size, append2020-12-14 10:05:46

    #include<iostream.h> #include<string> int main() // main function { std::string greeting = "Hello"; // empty string: "" greeting += "!"; // string method cout << greeting[5] << endl; // ! cout &l

  • 单片机实验练习代码2020-12-14 10:01:37

    实验一 #include <reg52.h> #include <stdio.h> #define uint unsigned int #define uchar unsigned char sbit key = P3^2; //定义一个按键用于给单片机给电脑发信息 void delayms(uint z) //延时函数 ms级 { uint i,y; for(i=z;i>0;i--) for(y=110;y>0;y--); } voi

  • boost读写锁测试代码2020-12-14 05:01:24

    两个线程可以同时读。但是有写的时候,是全部锁定。#include <boost/thread.hpp> #include <thread> int _tmain(int argc, _TCHAR* argv[]) { std::vector<int> items; boost::shared_mutex mutex; std::thread r1([&]() mutable { while (true) {

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

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

ICode9版权所有