結果

問題 No.2828 Remainder Game
ユーザー begemotbegemot
提出日時 2024-08-02 22:29:59
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 479 bytes
コンパイル時間 649 ms
コンパイル使用メモリ 65,516 KB
実行使用メモリ 25,464 KB
平均クエリ数 1057.50
最終ジャッジ日時 2024-08-02 22:30:05
合計ジャッジ時間 3,567 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 61 ms
24,824 KB
testcase_16 AC 62 ms
25,208 KB
testcase_17 AC 62 ms
24,568 KB
testcase_18 AC 60 ms
25,208 KB
testcase_19 AC 62 ms
24,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
typedef long long ll;
const int MAXN = 2e5 + 5;
using namespace std;
int a[MAXN], N, res, tmp;
int main() {
	ios::sync_with_stdio(false);
	cin >> N;
	for (int i = N; i >= 1; --i) {
		cout << i << " " << 1 << endl;
		cout << 0 << endl;
		cin >> tmp;
		if (tmp + a[i]) {
			res += i * (tmp + a[i]);
			for (int j = 1; j < i; ++j) {
				if (i % j == 0) a[j] = a[j] - (tmp + a[i]);
  			}
		} 
	}
	cout << 0 << " " << 1 << endl;
	cout << res << endl;
	return 0;
}
0