結果
問題 |
No.72 そろばん Med
|
ユーザー |
![]() |
提出日時 | 2016-04-11 01:17:39 |
言語 | C90 (gcc 12.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 405 bytes |
コンパイル時間 | 357 ms |
コンパイル使用メモリ | 20,480 KB |
実行使用メモリ | 7,972 KB |
最終ジャッジ日時 | 2024-10-04 05:59:09 |
合計ジャッジ時間 | 12,677 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | TLE * 1 -- * 23 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:9:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%lld",&n); | ^~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #define mod 1000007 int main(){ long long int i,j; long long int n; long long int ans; long long int ans_p,max_p=0; long long int ans_r,max_r=0; scanf("%lld",&n); for(i=1;i<=n/2;i++){ ans=i+(i+1)*(n-i); ans_p=ans/mod; ans_r=ans%mod; if(max_p<=ans_p){ if(max_r<ans_r) max_p=ans_p; max_r=ans_r; } } printf("%lld\n",max_r); return 0; }