首页 > 其他分享 >ABC325

ABC325

时间:2023-10-21 23:12:14浏览次数:39  
标签:24 int rep namespace cin ABC325 main

T1:Takahashi san

模拟

代码实现
#include <bits/stdc++.h>

using namespace std;

int main() {
    string s, t;
    cin >> s >> t;
    
    cout << s << ' ' << "san";
    
    return 0;

}

T2:World Meeting

暴力枚举

代码实现
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)

using namespace std;

int main() {
    int n;
    cin >> n;
    
    vector<int> w(n), x(n);
    rep(i, n) cin >> w[i] >> x[i];
    
    int ans = 0;
    rep(t, 24) {
        int now = 0;
        rep(i, n) {
            int y = (x[i]+t)%24;
            if (9 <= y and y < 18) now += w[i];
        }
        ans = max(ans, now);
    }
    
    cout << ans << '\n';
    
    return 0;

}

T3:

标签:24,int,rep,namespace,cin,ABC325,main
From: https://www.cnblogs.com/Melville/p/17779725.html

相关文章