結果

問題 No.250 atetubouのzetubou
ユーザー bal4u
提出日時 2019-07-15 08:22:52
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 48 ms / 5,000 ms
コード長 784 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 29,824 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-26 01:55:51
合計ジャッジ時間 1,421 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'in':
main.c:8:14: warning: implicit declaration of function 'getchar_unlocked' [-Wimplicit-function-declaration]
    8 | #define gc() getchar_unlocked()
      |              ^~~~~~~~~~~~~~~~
main.c:15:28: note: in expansion of macro 'gc'
   15 |         int n = 0; int c = gc();
      |                            ^~
main.c: In function 'outs':
main.c:9:15: warning: implicit declaration of function 'putchar_unlocked' [-Wimplicit-function-declaration]
    9 | #define pc(c) putchar_unlocked(c)
      |               ^~~~~~~~~~~~~~~~
main.c:26:33: note: in expansion of macro 'pc'
   26 | void outs(char *s) { while (*s) pc(*s++); pc('\n'); }
      |                                 ^~

ソースコード

diff #

// yukicoder: No.250 atetubouのzetubou
// 2019.7.15 bal4u

#include <stdio.h>

typedef long long ll;
#if 1
#define gc() getchar_unlocked()
#define pc(c) putchar_unlocked(c)
#else
#define gc() getchar()
#define pc(c) putchar(c)
#endif
int in() {   // 非負整数の入力
	int n = 0; int c = gc();
	do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
	return n;
}

ll In() {   // 非負整数の入力
	ll n = 0; int c = gc();
	do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
	return n;
}

void outs(char *s) { while (*s) pc(*s++); pc('\n'); }

int main()
{
	int i, Q, D, X; ll T, ans;
	
	Q = in(); while (Q--) {
		D = in(), X = in(), T = In(), ans = 1;
		for (i = 1; i < D; i++) {
			if ((ans = ans*(X+i)/i) > T) break;
		}
		outs(ans <= T? "AC": "ZETUBOU");
	}
	return 0;
}
0