結果
| 問題 | No.3402 [Cherry Anniversary 5] Beyond Zelkova, the 5th year vista seen through the bloom of a cherry bloosom |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-09 00:11:09 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 940 bytes |
| 記録 | |
| コンパイル時間 | 1,754 ms |
| コンパイル使用メモリ | 196,260 KB |
| 実行使用メモリ | 7,852 KB |
| 最終ジャッジ日時 | 2025-12-09 00:12:01 |
| 合計ジャッジ時間 | 4,854 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 24 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
vector<int> a = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool check(int y){
if(y % 400 == 0) return true;
if(y % 100 == 0) return false;
if(y % 4 == 0) return true;
return false;
}
int f(int y, int m, int d){
int res = 0;
for(int cy = 0; cy < y; cy++){
res += 365 + check(cy);
}
m--;
for(int i = 0; i < m; i++){
res += a[i] + (i == 1 && check(y));
}
res += d - 1;
return res;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int y1, m1, d1, y2, m2, d2;
cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
int sv = f(y2, m2, d2);
int a = sv - f(y1, m1, d1);
int Q;
cin >> Q;
while(Q--){
int y, m, d;
cin >> y >> m >> d;
int b = f(y, m, d) - sv - 1;
if(a < b) cout << "Less\n";
else if(a == b) cout << "Same\n";
else cout << "More\n";
}
}