結果
| 問題 |
No.304 鍵(1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-12-18 12:17:22 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 369 bytes |
| コンパイル時間 | 320 ms |
| コンパイル使用メモリ | 28,544 KB |
| 実行使用メモリ | 25,220 KB |
| 平均クエリ数 | 0.17 |
| 最終ジャッジ日時 | 2024-07-16 16:32:21 |
| 合計ジャッジ時間 | 3,825 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 TLE * 1 -- * 4 |
コンパイルメッセージ
main.c: In function 'main':
main.c:17:5: warning: implicit declaration of function 'getline' [-Wimplicit-function-declaration]
17 | getline(&str, &size, stdin);
| ^~~~~~~
ソースコード
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
char *str = NULL;
size_t size;
int used[999] = {};
int main() {
srand((unsigned)time(NULL));
while (1) {
int i = 0;
while (used[i]) {
i = rand() % 1000;
used[i] = 1;
}
printf("%03d\n", i);
fflush(stdout);
getline(&str, &size, stdin);
if (str[0] == 'u') return 0;
}
}