結果

問題 No.603 hel__world (2)
コンテスト
ユーザー testestest
提出日時 2017-11-21 00:38:51
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 427 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 62 ms
コンパイル使用メモリ 38,720 KB
実行使用メモリ 9,416 KB
最終ジャッジ日時 2026-07-21 17:28:45
合計ジャッジ時間 1,750 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 30
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:7:1: warning: return type defaults to 'int' [-Wimplicit-int]
    7 | main(){
      | ^~~~
main.c: In function 'main':
main.c:8:9: warning: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    8 |         gets(s);
      |         ^~~~
main.c:15:49: warning: passing argument 2 of 'strtoull' from incompatible pointer type [-Wincompatible-pointer-types]
   15 |                 unsigned long long x=strtoull(p,q,10);
      |                                                 ^
      |                                                 |
      |                                                 char *
In file included from main.c:3:
/usr/include/stdlib.h:207:59: note: expected 'char ** restrict' but argument is of type 'char *'
  207 |                                         char **__restrict __endptr, int __base)
      |                                         ~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from main.c:2:
main.c:23:23: warning: comparison between pointer and integer
   23 |         assert(gets(s)==NULL);
      |                       ^~
main.c:23:23: warning: comparison between pointer and integer
   23 |         assert(gets(s)==NULL);
      |                       ^~
/usr/bin/ld: /tmp/cc3xjA6U.o: in function `main':
main.c:(.text.startup+0x10): 警告: the `gets' function is dangerous and should not be used.

ソースコード

diff #
raw source code

#include <string.h>
#include <assert.h>
#include <stdlib.h>

char s[10000000],*p,*q;
int cnt;
main(){
	gets(s);
	p=strtok(s," ");
	while(p){
		cnt++;
		int n=strlen(p);
		assert(1<=n&&n<=19);
		assert(*p!='0'||n==1);
		unsigned long long x=strtoull(p,q,10);
		assert(q==NULL&&x<=1000000000000000000ULL);
		p=strtok(NULL," ");
	}
	assert(cnt==26);
	gets(s);
	int n=strlen(s);
	assert(1<=n&&n<=1000000);
	assert(gets(s)==NULL);
}
0