博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CF 1136B Nastya Is Playing Computer Games
阅读量:7084 次
发布时间:2019-06-28

本文共 555 字,大约阅读时间需要 1 分钟。

题目链接:codeforces.com/problemset/problem/1136/B

题目分析

    首先,读完题目,看了是个B题,嗯嗯......

    果断找规律,然后交了一波,居然过了!!!

代码区

#include
#include
#include
#include
#include
using namespace std;typedef long long ll;const int inf = 0x3f3f3f3f;const int Max = 5e2 + 10;const int mod = 1e9 + 7;int main(){ int n, k; while (scanf("%d%d", &n, &k) != EOF) { int a = min(abs(k - 1), abs(n - k)); printf("%d\n", 3 * n + a); } return 0;}

 

转载于:https://www.cnblogs.com/winter-bamboo/p/10634441.html

你可能感兴趣的文章
细谈软件需求分析过程:提取、抽象、升华
查看>>
影响网站关键词排名的因素
查看>>
我的友情链接
查看>>
信任、公平、梦想—新拍拍,新起点-拍拍网蒉莺春
查看>>
read和变量设定方式
查看>>
Winmail + Rsync + Nmap 实现 Winmail 邮件系统双机热备
查看>>
python读写文件
查看>>
自编应用程序输出重定向
查看>>
unix打包压缩命令详解
查看>>
我的友情链接
查看>>
神经网络在测试抽样中的应用
查看>>
我的友情链接
查看>>
aa卫生服娃fever务而非而个
查看>>
1-4常用路由协议的梳理
查看>>
CSS 绝对底部
查看>>
Javascript核心
查看>>
我的友情链接
查看>>
linux 漏洞扫描补丁修复
查看>>
linux学习笔记七:安装中文man手册
查看>>
使用iptables给内网服务器做端口映射
查看>>