三个题目分别考察大整数相加相乘相除运算.如果按照传统算法是取一个长数组,之后进行模拟或者FFT来进行运算.但是相对繁琐. 后来昨天的青岛区域赛网赛1001,用到了JAVA的BigDecimal,于是反过来想到了这几个题目.用JAVA写了以后果然很简单. 1002:大数相加: AC代码: import java.util.*; import java.math.*; public class Main { public static void main(String[] args) { // TO…
题意:n的阶乘后面0的个数,如果直接算出阶乘再数0的数量一定会超时的. 因为10=2*5,所以求出5贡献的次数就行. #include "bits/stdc++.h" using namespace std; #define LL long long #define INF 0x3f3f3f3f3f #define PI acos(-1) #define N 510 LL arr[N]; int main() { int n,k; while(~scanf("%d"…
思路: 2和5能构成0,然后就是看2和5因子组成个数,然而我们知道,1-n中2的因子数肯定>5的,所以我们只要求一下1-n中5的因子个数就好了... #include <stdio.h> #include <string.h> #include <iostream> using namespace std; typedef long long LL; //求1-n有x因子的个数,给出一个n: int main() { int n; int ans=0; scanf…
Response message: Received: Close frame with status code 1009 and close reason 'No async message support and buffer too small. Buffer size: [8,192], Message size: [51,926]' 断开原因 WebSocket断开的原因有很多,最好在WebSocket断开时,将错误打印出来. ws.onclose = function (e) { c…