結果
| 問題 | No.701 ひとりしりとり | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2018-06-16 13:44:29 | 
| 言語 | C (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 333 bytes | 
| コンパイル時間 | 161 ms | 
| コンパイル使用メモリ | 29,568 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-06-30 16:14:06 | 
| 合計ジャッジ時間 | 2,018 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| 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(0);
	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;
}
            
            
            
        