結果

問題 No.375 立方体のN等分 (1)
ユーザー compass19compass19
提出日時 2016-06-05 00:41:14
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 541 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 21,120 KB
実行使用メモリ 6,784 KB
最終ジャッジ日時 2024-04-17 03:31:19
合計ジャッジ時間 6,881 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 0 ms
5,376 KB
testcase_02 WA -
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 24 ms
5,376 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:19:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   19 |     scanf("%d", &n);
      |     ^~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h> 

int find(int l, int n){
	int i, j, k;
	for (i = l; i >= (int)(l/3); i--){
		for (j = (int)(n/(i+1))-1; j >= 0; j--){
			k = l - i - j;
			if (k <= j){
				if ((i+1)*(j+1)*(k+1) == n){
					return 1;
				}
			}
		}
	}
	return 0;
}
int main(int argc, char *argv[]){
    int n;
    scanf("%d", &n);
    int l = 0;
    while (l*l*l < n){
    	l++;
    }
    if (n == 1 || n == 2){
    	l--;
    }
    int sigh = 0;
    while (sigh == 0){
    	sigh = find(l,n);
    	l++;
    }
    printf("%d %d\n", l-1,n-1);
    return 0;
}
0