結果

問題 No.1022 Power Equation
ユーザー game_krbgame_krb
提出日時 2020-04-20 18:41:34
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 593 bytes
コンパイル時間 432 ms
コンパイル使用メモリ 32,128 KB
実行使用メモリ 12,544 KB
最終ジャッジ日時 2024-04-16 00:51:43
合計ジャッジ時間 6,798 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

/*
No. 1022 Power Equation
*/
#include <stdio.h>
#include <math.h>

#define T 50

int main(void)
{
	int t,n[T],i,a,b,c,d;
	
	scanf("%d",&t);
	
	for(i=0;i<t;i++){
		scanf("%d",&n[i]);
		//printf("%d:%d\n",i,n[i]); //test
	}

	for(i=0;i<t;i++){
		int count=0;
		
		for(a=1;a<=n[i];a++){
			
			for(b=1;b<=n[i];b++){
				for(c=1;c<=n[i];c++){
					for(d=1;d<=n[i];d++){
						if(pow(a,b)==pow(c,d))
							count++;
					}
				}
			}
			
			//printf("%d ",a); 
		}
		//putchar('\n');
		printf("%d\n",count);
		//printf("%d\n",t); //test
	}
	
	return 0;
}
0