結果
| 問題 |
No.701 ひとりしりとり
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-06-16 13:41:45 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 356 bytes |
| コンパイル時間 | 150 ms |
| コンパイル使用メモリ | 29,440 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-30 16:13:25 |
| 合計ジャッジ時間 | 1,891 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 10 |
コンパイルメッセージ
main.c: In function 'main':
main.c:12:83: warning: integer overflow in expression of type 'int' results in '-2147483648' [-Woverflow]
12 | for (j = 0; j < 20; j++) s[j] = 'a' + rand()*('z' - 'a' + 1) / (1 + RAND_MAX);
| ^
ソースコード
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void)
{
char s[21];
int n, i, j;
srand((unsigned int)time(NULL));
scanf("%d", &n);
for (i = 1; i < n; i++) {
for (j = 0; j < 20; j++) s[j] = 'a' + rand()*('z' - 'a' + 1) / (1 + RAND_MAX);
s[20] = '\0';
puts(s);
}
printf("aaaaaaaaaaaaaaaaaaan\n");
return 0;
}