結果
問題 | No.87 Advent Calendar Problem |
ユーザー |
|
提出日時 | 2016-04-01 01:03:09 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 476 bytes |
コンパイル時間 | 455 ms |
コンパイル使用メモリ | 54,008 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-02 08:43:49 |
合計ジャッジ時間 | 1,402 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include <iostream>int main() {std::ios::sync_with_stdio(false);std::cin.tie(0);long long int n, day = 0, sameCount = 0;std::cin >> n;for(int i=2015; i<(n-2014)%2800+2015; ++i){day+=365;if(i%400==0){++day;}else if(i%4==0 && i%100!=0){++day;}if(day%7==0){++sameCount;}}std::cout << (n-2014)/2800*399 + sameCount << "\n";return 0;}