結果
| 問題 | No.87 Advent Calendar Problem |
| コンテスト | |
| ユーザー |
TLwiegehtt
|
| 提出日時 | 2015-07-13 16:00:21 |
| 言語 | C90 (gcc 12.4.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 387 bytes |
| 記録 | |
| コンパイル時間 | 244 ms |
| コンパイル使用メモリ | 20,864 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2024-07-08 06:59:56 |
| 合計ジャッジ時間 | 12,480 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | TLE * 1 -- * 23 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%lld", &n);
| ^~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void){
long long int n,h,J,K,ans=0;
long long int th, y = 2014, m = 7, d = 23;
J = y/100;
K = y%100;
h = (d + ((m+1)*26/10) + K + (K/4) + (J/4) + 5*J)%7;
scanf("%lld", &n);
for(y=2015;y<=n;y++){
J = y/100;
K = y%100;
th = (d + ((m+1)*26/10) + K + (K/4) + (J/4) + 5*J)%7;
if(h == th){
ans++;
}
}
printf("%lld\n", ans);
return 0;
}
TLwiegehtt