CCF——2019/12/15——第五题——魔数(10分)

 题目链接

/*10分....*/

#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>


using namespace std;

const int M = 1e5;
int a[M];

int f(int x){
	return x % 2019;
}

bool is_dig(char c){
	if(c=='0' || c=='1' || c=='2' || c=='3' || c=='4' || c=='5' || c=='6' || c=='7' || c=='8' || c=='9'){
		return true;
	}
	
	return false;
}

void f2(string s,int x){
	for(int i=s.length(); i>0; i--){
		if(s[i] )
	}
}

int main(void)
{
	string U0 = "314882150829468584";
	string U1 = "427197303358170108";
	string U2 ="1022292690726729920";
	string U3 = "1698479428772363217";
	string U4 = "2006101093849356424";
	
	int n,q;
	cin >> n >> q;
	
	for(int i=1; i<=n; i++){
		a[i] = i;
	}
	
	for(int i=0; i<q; i++){
		int l,r;
		cin >> l >> r;
		
		int sum = 0;
		for(int j=l; j<=r; j++){
			sum += f(j);
		}
		
		cout << sum;
		
		int t = sum % 5;
		
		
		
	} 

	
	return 0;
}

10分 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值