当前位置:网站首页>2020 ICPC Shanghai Site G
2020 ICPC Shanghai Site G
2022-08-10 19:07:00 【eyuhaobanga】
可知x·y为偶数,那么x和y的组成要么是一奇一偶要么是两个偶数,所以通过观察Fibonacci数列可以得到,每三个作为一个循环,每个循环前两个为奇数,第三个为偶数,因此偶数的个数就是,奇数的个数就是,因此奇数和偶数互相匹配的个数就是,偶数匹配偶数可以得到一个等差数列,根据等差数列求和公式得到
AC代码:
#include <bits/stdc++.h> #define rep(i,a,n) for(int i=a;i<n;i++) using namespace std; using LL = long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; int cnt = n / 3; LL ans = 1ll * cnt * (n - cnt) + 1ll * (cnt - 1) * cnt / 2; cout << ans << '\n'; return 0; }
边栏推荐
- 【Knowledge Sharing】What is SEI in the field of audio and video development?
- Metasploit——渗透攻击模块(Exploit)
- 【知识分享】在音视频开发领域中SEI到底是个啥?
- 巧用RoaringBitMap处理海量数据内存diff问题
- 七月券商金工精选
- 从 Delta 2.0 开始聊聊我们需要怎样的数据湖
- The servlet mapping path matching resolution
- [Go WebSocket] Your first Go WebSocket server: echo server
- 铱钌合金/氧化铱仿生纳米酶|钯纳米酶|GMP-Pd纳米酶|金钯复合纳米酶|三元金属Pd-M-Ir纳米酶|中空金铂合金纳米笼核-多空二氧化硅壳纳米酶
- 【初学必备】3d游戏建模入门基础知识
猜你喜欢
电脑为什么会蓝屏的原因
网站架构探测&chrome插件用于信息收集
[Teach you how to do mini-games] How to lay out the hands of Dou Dizhu?See what the UP master of the 250,000 fan game area has to say
铁蛋白颗粒Tf包载多肽/凝集素/细胞色素C/超氧化物歧化酶/多柔比星(定制服务)
【毕业设计】基于STM32的天气预报盒子 - 嵌入式 单片机 物联网
3D Game Modeling Learning Route
[Teach you how to make a small game] Write a function with only a few lines of native JS to play sound effects, play BGM, and switch BGM
- [email protected] NPs)"/>
转铁蛋白修饰蛇床子素长循环脂质体/负载三七皂苷R1的PEG-PLGA纳米粒([email protected] NPs)
机器学习|模型评估——AUC
[教你做小游戏] 只用几行原生JS,写一个函数,播放音效、播放BGM、切换BGM
随机推荐
【Knowledge Sharing】What is SEI in the field of audio and video development?
【初学必备】3d游戏建模入门基础知识
【LeetCode】42、接雨水
苹果字体查找
GBASE 8s 高可用RSS集群搭建
“2022零信任神兽方阵”启动调研,欢迎各单位填报信息
TikTok选品有什么技巧?
转铁蛋白修饰长春新碱-粉防己碱脂质体|转铁蛋白修饰共载紫杉醇和金雀异黄素脂质体(试剂)
补坑求逆序对
转铁蛋白(Tf)修饰去氢骆驼蓬碱磁纳米脂质体/香豆素-6脂质体/多柔比星脂质体
WCF and TCP message communication practice, c # 】 【 realize group chat function
flask生成路由的2种方式和反向生成url
YOLOv3 SPP源码分析
QoS服务质量八拥塞避免
转铁蛋白修饰蛇床子素长循环脂质体/负载三七皂苷R1的PEG-PLGA纳米粒([email protected] NPs)
皮质-皮质网络的多尺度交流
30分钟使用百度EasyDL实现健康码/行程码智能识别
Today's bug, click on the bug that the Windows dynamic wallpaper disappears in the win10 taskbar, and no solution has been found yet.
从 GAN 到 WGAN
3D游戏建模学习路线