結果
| 問題 |
No.2259 Gas Station
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-04-17 22:37:08 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 714 bytes |
| コンパイル時間 | 282 ms |
| コンパイル使用メモリ | 29,184 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-12 22:43:39 |
| 合計ジャッジ時間 | 11,197 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 WA * 10 |
コンパイルメッセージ
main.c: In function 'main':
main.c:6:5: warning: implicit declaration of function 'srand' [-Wimplicit-function-declaration]
6 | srand(time(NULL));
| ^~~~~
main.c:6:11: warning: implicit declaration of function 'time' [-Wimplicit-function-declaration]
6 | srand(time(NULL));
| ^~~~
main.c:2:1: note: 'time' is defined in header '<time.h>'; did you forget to '#include <time.h>'?
1 | #include<stdio.h>
+++ |+#include <time.h>
2 | //#include<time.h>
ソースコード
#include<stdio.h>
//#include<time.h>
//#include<stdlib.h>
int main(void){
srand(time(NULL));
int L,R,C,x;
int oturi,min;
//int second;
scanf("%lld %lld %lld",&L,&R,&C);
min = 999;
//while(second < 2){
//second = time(NULL);
//L = rand();
//R = rand();
//C = rand();
for(x = L;x <= R;x++){
oturi = ((1000 - ((x*C) % 1000)) % 1000);
if(oturi < min){
min = oturi;
}
}
//printf("L:%d R:%d C:%d\n",L,R,C);
printf("%d\n",min);
//second = time(NULL) - second;
//printf("経過時間:%d\n",second);
//printf("\n");
//}
return 0;
}