1 2 3 4 5 6 7

4-5-3-6-2-7-1

答案是(n-1)/2

#include<cstdio>
using namespace std;
int n;
int main(){
scanf("%d",&n);
printf("%d\n",(n-1)/2);
return 0;
}

【推导】Codeforces Round #411 (Div. 1) A. Find Amir的更多相关文章

  1. Codeforces Round #411 (Div. 2) C. Find Amir

    C. Find Amir time limit per test   1 second memory limit per test   256 megabytes   A few years ago ...

  2. 【推导】Codeforces Round #411 (Div. 1) B. Minimum number of steps

    最后肯定是bbbb...aaaa...这样. 你每进行一系列替换操作,相当于把一个a移动到右侧. 会增加一些b的数量……然后你统计一下就行.式子很简单. 喵喵喵,我分段统计的,用了等比数列……感觉智障 ...

  3. Codeforces Round #411 (Div. 2)(A,B,C,D 四水题)

    A. Fake NP time limit per test:1 second memory limit per test:256 megabytes input:standard input out ...

  4. Codeforces Round #411 (Div. 1) D. Expected diameter of a tree

    题目大意:给出一个森林,每次询问给出u,v,问从u所在连通块中随机选出一个点与v所在连通块中随机选出一个点相连,连出的树的直径期望(不是树输出-1).(n,q<=10^5) 解法:预处理出各连通 ...

  5. Codeforces Round #411 (Div. 2)

    来自FallDream的博客,未经允许,请勿转载,谢谢. 由于人傻又菜 所以这次又滚去div2了  一堆结论题真的可怕 看见E题不是很有思路   然后就去大力搞F题  T了最后一个点 真的绝望   但 ...

  6. Codeforces Round #411 div 2 D. Minimum number of steps

    D. Minimum number of steps time limit per test 1 second memory limit per test 256 megabytes input st ...

  7. Codeforces Round #411 (Div. 2) 【ABCDE】

    A. Fake NP 题意:给你l,r,让你输出[l,r]里面除1以外的,出现因子数量最多的那个数. 题解:如果l==r输出l,否则都输出2 #include<bits/stdc++.h> ...

  8. Codeforces Round #411 (Div. 2) A-F

    比赛时候切了A-E,fst了A Standings第一页只有三个人挂了A题,而我就是其中之一,真™开心啊蛤蛤蛤 A. Fake NP time limit per test 1 second memo ...

  9. 【DFS】【贪心】Codeforces Round #411 (Div. 1) C. Ice cream coloring

    对那个树进行dfs,在动态维护那个当前的冰激凌集合的时候,显然某种冰激凌仅会进出集合各一次(因为在树上形成连通块). 于是显然可以对当前的冰激凌集合贪心染色.暴力去维护即可.具体实现看代码.map不必 ...

随机推荐

  1. bzoj 2121 DP

    首先如果我们能处理出来i,j段能不能消掉,这样就可以直接dp转移了,设w[i]为前i为最少剩下多少,那么w[i]=w[j-1] (flag[j][i]). 现在我们来求flag[i][j],首先我们可 ...

  2. 项目记录 -- zpool set

    zfs set <property=value> <filesystem|volume|snapshot> root@UA4300D-spa:~/hanhuakai/pro_0 ...

  3. mssql手工注入1

    强制字符转成数字, 所以报错, 能获得数据 查版本号: http: -- 查数据库版本: http: -- 查当前数据库用户(如果看到dbo 那么多半当前数据库的用户是dba权限): http: -- ...

  4. Xcode7 iOS9.0 的真机调试

    Xcode7的真机调试: 1.Xcode偏好 -> 账号 -> 增加 Apple ID ->显示 free 2.Target 运行 iOS 版本号 3.修正 Team 项   选择 ...

  5. Python的数值和字符串

    Python数据类型 1.数值 --类型:  1/整型 2/长整型   3/浮点型 -- 0.0, 12.0, -18.8, 3e+7等 4/复数型 -- complex  In []: 0x34al ...

  6. Leetcode 之Same Tree(48)

    用递归比较简单,这里用迭代的方式实现.注意什么时候返回true,什么时候返回false. bool isSameTree(TreeNode *p, TreeNode *q) { stack<Tr ...

  7. Maximum Subarray——经典

    Find the contiguous subarray within an array (containing at least one number) which has the largest ...

  8. C++编译常见错误

    error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To di ...

  9. VS的使用

    配置一个工程 问题描述: 要运行一个源码工程,工程中含有层级目录,.cpp与.h在多级目录中混合存储.并且该工程的运行依赖一些静态库(.lib)与动态库(.dll). 建立: 把.h拷贝至$(Proj ...

  10. GZIP压缩占用CPU大吗?

    http://blog.csdn.net/hguisu/article/details/7793038 Filter之——GZIP全站压缩 http://www.cnblogs.com/jbelial ...