結果

問題 No.1899 L1 Cafe
ユーザー 37zigen
提出日時 2022-01-31 06:23:50
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 482 bytes
コンパイル時間 3,610 ms
コンパイル使用メモリ 139,128 KB
最終ジャッジ日時 2025-01-27 18:02:16
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other RE * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%lld", &T);
      |         ~~~~~^~~~~~~~~~~~
main.cpp:12:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |                 scanf("%lld%lld%lld", &n, &a, &b);
      |                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<cstdio>
#include<atcoder/all>
#include<assert.h>
using namespace atcoder;
typedef long long ll;
int main() {
    ll T;
	scanf("%lld", &T);
	assert(1 <= T && T <= 1e4);
	while (T--) {
		ll n, a, b;
		scanf("%lld%lld%lld", &n, &a, &b);
		assert(2 <= n && n <= 1e9);
		assert(1 <= a && a <= 1e9);
		assert(1 <= b && b <= 1e9);
		
		ll ans = floor_sum(n/a, 1, -a, n-a) + floor_sum(n/b, 1, -b, n-b) - floor_sum(n/a, b, -a, n-a);
        printf("%lld\n", ans);
    }
	return 0;
}
0