結果

問題 No.637 X: Yet Another FizzBuzz Problem
コンテスト
ユーザー aaaa3215
提出日時 2018-03-30 15:38: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
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 526 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 207 ms
コンパイル使用メモリ 41,668 KB
最終ジャッジ日時 2026-02-22 00:55:57
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 2
other AC * 1 TLE * 1 -- * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<stdio.h>
#include<math.h>
#define NUM 5

int func(int n) {
	int a = pow(10, n);
	return a;
	}

int main(void) {
	int a[NUM];
	int sum = 0;
	int i;
	int j = 0;

	for (i = 0; i < NUM; i++) {
		scanf("%d", &a[i]);

		if ((a[i] % 5 == 0) && (a[i] % 3 == 0)) {
			sum += 8;
		}

		else if ((a[i] % 5 != 0)&&(a[i] % 3 != 0)) {
			while (1) {
				if ((a[i] / pow(10,j) >= 1) && (a[i] / pow(10,j+1) < 1)) {
					sum += j+1;
					break;
				}
				j++;
			}
		}

		else {
			sum += 4;
		}
	}

	printf("%d", sum);

	return 0;

}
0