M. Game Theory
time limit per test
1 second
memory limit per test
512 megabytes
input
standard input
output
standard output
Grammy is a CS professor at Sakuya Academy and she teaches Game Theory this semester.
Including Grammy herself, there are nn people in the class. Today, in order to attract students' interest, she decides to play a game with all students.
For each student, Grammy will pick an integer xx (1≤x≤20)1≤x≤20). Without knowing what Grammy picks, the student will also pick another integer yy (1≤y≤20)1≤y≤20). In the next step, Grammy calculate the score through the following procedure with each student independently.
- Grammy will give the student xx points.
- The student will give Grammy yy points.
- If Grammy's integer xx is strictly greater than yy, then she will obtain 1010 extra points from the student.
- If Grammy's integer xx is strictly less than yy, then she will give 1010 extra points to the student.
Now Grammy wants to know the expected amount of points she may win from all students if she chooses to pick the integer randomly and independently, which means for all integers in [1,20][1,20], they all share the same possibility. Since students are very clever, you may assume that they will follow the optimal strategy in this game to maximize their final score.
Note that during the game, if one gives out points, he will lose the same amount of points. Moreover, the total point one obtains can be negative.
Input
The input contains only a single case.
The only line of the input contains an integer nn (1≤n≤10001≤n≤1000), indicating the total number of people in the class (Including Grammy).
Output
Output the answer in one line. Your answer will be considered correct if and only if the absolute or relative error does not exceed 10−410−4.
Example
input
Copy
1
output
Copy
0.0000
题目大意:就是老师面对n个学生,老师对每个学生给出一个数x,学生在不知道老师给出的数是多少的情况下,给出一个数y,数x,y都是大于等于0小于等于20的x>y老师从学生那里得到十分,反之,x<y学生从老师那里得到十分,最后让你输出老师的得分
解题思路:很明显是一道博弈论的题目,谁都不想让自己的得分少,所以不管是老师还是学生都会选择最大的数20,因为只有给出20是不可能失分的,就这样就会造成一个奇异,就是最后大家平手,最后得分都是0
下面附上ac代码
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <set>
#include <map>
#define dbg(a) cout<<#a<<" : "<<a<<endl;
using namespace std;
typedef long long ll;
ll a[1000010];
ll vis[1000010];
map<ll,ll> ss;
int main()
{
std::ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
ll n;
cin>>n;
cout<<0.0000<<endl;
return 0;
}