//枚举两个端点classSolution{boolcheck(int i,int j, string& s){
string t;for(int k = j; k >= i;--k){
t += s[k];}return t == s.substr(i,j-i+1);}public:intgetLongestPalindrome(string A){// write code hereint n = A.size(), len =0;for(int i =0; i < n;++i){for(int j = i; j < n;++j){if(check(i, j, A))
len =max(len, j - i +1);}}return len;}};
//枚举中心的点(中心扩展算法)classSolution{public:intgetLongestPalindrome(string s){// write code hereint n = s.size();int ret =1;for(int i =0; i < n;++i){int left = i -1, right = i +1;while(left >=0&& right < n && s[left]== s[right]){--left,++right;}
ret =max(ret, right - left -1);
left = i, right = i +1;while(left >=0&& right < n && s[left]== s[right]){--left,++right;}
ret =max(ret, right - left -1);}return ret;}};
//动态规划#include<iostream>#include<vector>usingnamespace std;int n;constint N =100010;int price[N];intmain(){
cin >> n;for(int i =0; i < n; i++){scanf("%d",&price[i]);}
vector<vector<int>>f(n,vector<int>(2));auto g = f;//f[i][j]代表的是处于买入状态的最大的利润//g[i][j]代表的是处于可交易状态的最大的利润
f[0][0]=-price[0];for(int i =1; i < n; i++){for(int j =0; j <2; j++){
f[i][j]=max(f[i -1][j], g[i -1][j]- price[i]);
g[i][j]= g[i -1][j];if(j >=1)g[i][j]=max(g[i][j], f[i -1][j -1]+ price[i]);}}printf("%d\n",max(g[n -1][0], g[n -1][1]));return0;}
//贪心#include<iostream>#defineinf0x3f3f3f3fusingnamespace std;intmain(){int n;
cin>>n;int mi = inf,ma=-inf;int ans =0;while(n--){int x;
cin>>x;
mi =min(mi,x);
ans =max(ans,x-mi);}
cout<<ans<<'\n';return0;}// 64 位输出请用 printf("%lld")
#include<iostream>usingnamespace std;int n, m, x, y;longlong dp[25][25];intmain(){
cin >> n >> m >> x >> y;
x +=1;
y +=1;
dp[0][1]=1;for(int i =1; i <= n +1; i++){for(int j =1; j <= m +1; j++){if(i!=x&&j!=y&&abs(i - x)+abs(j - y)==3||(i == x &&
j == y)){
dp[i][j]=0;}else{
dp[i][j]= dp[i -1][j]+ dp[i][j -1];}}}
cout << dp[n +1][m +1]<< endl;return0;}