Mathematics Problem Set in Informatics Competition 241-250 (10 questions)

241, 3161: [Example 27.1] Find the sum and mean of integers

Informatics Olympiad - Programming Enlightenment (C++ version) Online Evaluation System

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int n,a,c;
	
	double p,s;
	
	cin>>n;
	
	for (int i=1;i<=n;++i)
	{
		cin>>a;
		s+=a;
	    p=s/n;
	} 
	
    c=s;
    
    printf("%d %0.5f\n",c,p);
    
	return 0;
}
/*
NOI / 1.5编程基础之循环控制
04求整数的和与均值 2021.11.13 AC
http://noi.openjudge.cn/ch0105/solution/31292749/
*/
#include<iostream>
using namespace std;
int main()
{
    int n;
    
	double sum=0,temp;
    
	cin>>n;
    
	for(int i=0;i<n;++i)
    {
        cin>>temp;
        sum+=temp;
    }
    
	printf("%.0f %.5f",sum,sum/(double)n); 
    
	return 0;
}



242, 3162: [Example 27.2] Minimum n value

Informatics Olympiad - Programming Enlightenment (C++ version) Online Evaluation System

243, 3163: [Example 27.3] Number of items

Informatics Olympiad - Programming Enlightenment (C++ version) Online Evaluation System

244, 3164: Practice 27.1 Ding Dang Dang Dang

Informatics Olympiad - Programming Enlightenment (C++ version) Online Evaluation System

#include<iostream>
using namespace std;
int main()
{
	int i;
	for(i=1;i<21;i++)
	{
		//' '中有1个空格
		cout<<i<<' ';             
		
		if(i%2==0) cout<<"叮叮";
		
		if(i%3==0) cout<<"当当";
		
		if(i%2==0||i%3==0) cout<<endl; 
	}	
	
	return 0;
}
/*
作业:
 
2019:【例4.4】求阶乘
http://ybt.ssoier.cn:8088/problem_show.php?pid=2019

1059:求平均年龄
http://ybt.ssoier.cn:8088/problem_show.php?pid=1059

1060:均值
http://ybt.ssoier.cn:8088/problem_show.php?pid=1060
*/ 


245, 3165: Practice 27.2 Burnat’s Problem

Informatics Olympiad - Programming Enlightenment (C++ version) Online Evaluation System

/*
试编一程序,求1+2+3+4+5的和。
1+2+3.....1000
1+2+3....100
*/
#include<iostream>
using namespace std;
int main()
{
	int i,sum=0;
	//i=i+1;
	/*
	for(i=1;i<=1000;i++)
	{
		sum+=i;
		//sum=sum+i;
	}
	*/
	
	//高斯的方法 
	//sum=(1+1000)*1000/2;
	sum=(1+5)*5/2;
	/*
	1+2+.....1000
	
	1+1000 1001
	2+999  1001
	....
	
	1000/2 *1001
	
	n*(n+1)/2
	*/
	
	cout<<"1+2+3+4+5="<<sum<<endl;

	return 0;
}
/*
作业:

1061:求整数的和与均值
http://ybt.ssoier.cn:8088/problem_show.php?pid=1061

1062:最高的分数
http://ybt.ssoier.cn:8088/problem_show.php?pid=1062

1063:最大跨度值
http://ybt.ssoier.cn:8088/problem_show.php?pid=1063 
*/



246, 940. Han Xin orders troops (Course A)

Log in

#include<bits/stdc++.h>
using namespace std;
int main()
{
	for(int i=1500;i>=1;i--)
	{
		if( i%3==2 && i%5==4 && i%7==6 )
		{
			cout<<i<<endl;
			break;	
		}	
	} 

	return 0;
}



247, 941. Find the sum of 1+2+3…+N (Course A)

Log in

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    
    cin>>n;
    
    cout<<(1+n)*n/2<<endl;
    
    return 0;
}



248, 675. Enter multiple ball colors (Magic Academy Lesson 13)

Log in

249, 87. Musical Score (Magic Academy Lesson 14)

Log in

250. 88. Concentric circles (Magic Academy Lesson 14)

Log in









Summary of questions related to number theory in the NOI question bank-2022.01.22

Summary of questions related to number theory in the NOI question bank-2022.01.22_noi Mathematics Summary-CSDN Blog

Topics related to introductory Luogu number theory--2022.01.22

Topics related to introductory Luogu number theory--2022.01.22_Number theory question listluogu-CSDN blog

Luo Gushenji Part 4 Basic Mathematics and Number Theory (Lessons 19-21)

Luogu Deep Basics Part 4 Basic Mathematics and Number Theory (Lessons 19-21)_Luogu Online School Resources Baidu Netdisk-CSDN Blog

Luo Gushenji Part 4 Basic Mathematics and Number Theory Chapter 19 Bit Operations and Base Conversion

Luogu Shenji Part 4 Basic Mathematics and Number Theory Chapter 19 Bit Operations and Base Conversion_Luogu Shenji Binary Conversion-CSDN Blog

Summary of relevant information on mathematical number theory in Xin'ao (2022.07.07)

Summary of relevant information on mathematical number theory in Xin'ao (2022.07.07)_Xin'ao Number Theory-CSDN Blog

NOIP CSP-J CSP-S Number theory past papers

NOIP CSP-J CSP-S Number Theory Previous Exam Questions_csp-j/s Previous Exam Questions-CSDN Blog

"Informatics Olympiad Comprehensive Guide"

"Informatics Olympiad One-Step Improvement Chapter"_Informatics Olympiad One-Step Improvement Chapter-CSDN Blog




【Mathematics 1】Basic Mathematical Problems

【Mathematics 1】Basic Mathematics Questions-Question List-Luogu

【Mathematics 2-1】Advanced Number Theory

【Mathematics 2-1】Advanced Number Theory-Question List-Luogu

【Mathematics 2-2】Combinatorics and Counting

[Mathematics 2-2] Combinatorial Mathematics and Counting-Question List-Luogu

【Mathematics 2-3】Probability and Statistics

【Mathematics 2-3】Probability and Statistics-Question List-Luogu

【Mathematics 2-4】Basic Linear Algebra

【Mathematics 2-4】Basic Linear Algebra-Question List-Luogu




NOI / Primary School Mathematical Olympiad

OpenJudge - OpenJudge - Question

NOI / 4.2 Algorithm Number Theory (11 questions)

OpenJudge - OpenJudge - Question

NOI question bank primary school math Olympiad (python)

NOI Question Bank Primary School Mathematical Olympiad-CSDN Blog

NOI openjudge question bank: Primary School Mathematical Olympiad (20 questions)

NOI openjudge question bank: Primary School Mathematical Olympiad (20 questions)-CSDN Blog

 




0x30 Mathematical knowledge (updating)

0x30 Mathematical Knowledge (Updating)-CSDN Blog

"Advanced Guide to Algorithm Competition" 0x30 Mathematical Knowledge Number Theory Questions

"Advanced Guide to Algorithm Competition" 0x30 Mathematical Knowledge Number Theory Questions_"Calculating Orders" "0x30 Mathematical Knowledge" sumdiv c++-CSDN Blog

 




Learn Xin'ao (CSP-J CSP-S NOIP, etc.) and practice with competitions which competitions you can participate in

Learn Xin'ao (CSP-J CSP-S NOIP, etc.) and practice with competitions. Which competitions can you participate in - CSDN Blog

 

Guess you like

Origin blog.csdn.net/dllglvzhenfeng/article/details/135283376