2023 Hubei Provincial Collegiate Programming Contest TC

MC里面无限水的模型

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#define For(i, j, n) for(int i = j ; i <= n ; ++i)
using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    int t = n + m;
    if((n + m) & 1 == 0)
        cout << (n + m)/2;
    else
        cout << (n + m + 1)/2;
    return 0;
}

 

posted @ 2024-03-23 00:19  Gold_stein  阅读(13)  评论(0编辑  收藏  举报