結果

問題 No.498 ワープクリスタル (給料日編)
コンテスト
ユーザー testestest
提出日時 2017-06-15 00:44:28
言語 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
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 376 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 59 ms
コンパイル使用メモリ 26,584 KB
最終ジャッジ日時 2026-02-21 23:53:28
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
    1 | M=1e9+7;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'M' [-Wimplicit-int]
main.c:2:1: warning: data definition has no type or storage class
    2 | c[9],a[99];long n,i,j,k,t,T,f,p,q,s,S;
      | ^
main.c:2:1: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
main.c:2:6: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
    2 | c[9],a[99];long n,i,j,k,t,T,f,p,q,s,S;
      |      ^
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:7: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 | for(;~scanf("%d",a+n);n++);
      |       ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | M=1e9+7;
main.c:4:7: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 | for(;~scanf("%d",a+n);n++);
      |       ^~~~~
main.c:4:7: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:24:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   24 | printf("%d",S%M);
      | ^~~~~~
main.c:24:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:24:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:24:1: note: include '<stdio.h>' or provide a declaration of 'printf'

ソースコード

diff #
raw source code

M=1e9+7;
c[9],a[99];long n,i,j,k,t,T,f,p,q,s,S;
main(){
for(;~scanf("%d",a+n);n++);
for(;i++<1<<n/3*4;){
	f=1;
	T=s=p=q=0;
	for(j=0;j<n/3;j++){
		c[j]=t=i>>j*4&15;
		p+=t*a[3*j+3];
		q+=t*a[3*j+4];
		f&=t<=a[3*j+5];
		s+=t;
	}
	if(p==a[0]&&q==a[1]&&f)for(T=1,j=0;j<n/3;j++){
		for(k=0;k++<c[j];){
			T=(T*s--)%M;
			while(T%k)T+=M;
			T/=k;
		}
	}
	S+=T;
}
printf("%d",S%M);
}
0