Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
158756 陈襗葳 过生日 C++ Accepted 2 MS 268 KB 549 2026-08-22 17:05:33

Tests(1/1):


Code:

#include <iostream> using namespace std; bool is_leap(int y) { if((y%4==0 && y%100!=0) || y%400==0) return true; return false; } int main() { int T; cin >> T; while(T--) { int Y,N; cin >> Y >> N; int cnt = 0; int ans; for(int i=Y; ;i++){ if(is_leap(i)) { cnt++; if(cnt == N) { ans = i; break; } } } cout << ans << endl; } }