結果
問題 |
No.677 10^Nの約数
|
ユーザー |
![]() |
提出日時 | 2018-04-30 04:47:37 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 970 bytes |
コンパイル時間 | 208 ms |
コンパイル使用メモリ | 32,128 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-06-27 23:46:54 |
合計ジャッジ時間 | 5,364 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 7 WA * 8 TLE * 1 -- * 1 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:37:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 37 | scanf("%d",&n); | ~~~~~^~~~~~~~~
ソースコード
#include <stdio.h> #include <math.h> #define STACK_SIZE 1000 #define SUCCESS 1 #define FAILURE 0 typedef long unsigned int data_t; data_t stack_data[STACK_SIZE]; int stack_num; int push(data_t push_data) { if (stack_num < STACK_SIZE) { stack_data[stack_num] = push_data; stack_num ++; return SUCCESS; } else { return FAILURE; } } int pop(data_t *pop_data) { if (stack_num > 0) { stack_num --; *pop_data = stack_data[stack_num]; return SUCCESS; } else { return FAILURE; } } int main(){ int n = 0; scanf("%d",&n); long unsigned int a = pow(10, n); long double b = sqrt(a); stack_num = 0; for(int i=1; i<=b; i++){ if(a%i==0){ if(a%i!=i){ push(a/i); } printf("%d\n",i); } } long unsigned int tmp; while(pop(&tmp)){ printf("%lu\n",tmp); } }