結果

問題 No.1114 足し算盆に返らず
ユーザー Y17Y17
提出日時 2020-07-17 21:44:51
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 20 ms / 2,000 ms
コード長 523 bytes
コンパイル時間 1,604 ms
コンパイル使用メモリ 170,672 KB
実行使用メモリ 5,892 KB
最終ジャッジ日時 2023-08-20 00:23:57
合計ジャッジ時間 7,694 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
5,636 KB
testcase_01 AC 20 ms
5,668 KB
testcase_02 AC 19 ms
5,892 KB
testcase_03 AC 15 ms
5,172 KB
testcase_04 AC 18 ms
5,676 KB
testcase_05 AC 10 ms
4,516 KB
testcase_06 AC 19 ms
5,860 KB
testcase_07 AC 18 ms
5,572 KB
testcase_08 AC 11 ms
4,732 KB
testcase_09 AC 10 ms
4,508 KB
testcase_10 AC 11 ms
4,712 KB
testcase_11 AC 3 ms
4,380 KB
testcase_12 AC 13 ms
4,972 KB
testcase_13 AC 19 ms
5,796 KB
testcase_14 AC 4 ms
4,384 KB
testcase_15 AC 8 ms
4,504 KB
testcase_16 AC 10 ms
4,536 KB
testcase_17 AC 13 ms
4,936 KB
testcase_18 AC 6 ms
4,380 KB
testcase_19 AC 8 ms
4,384 KB
testcase_20 AC 19 ms
5,608 KB
testcase_21 AC 8 ms
4,380 KB
testcase_22 AC 2 ms
4,384 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 2 ms
4,384 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define int long long
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

signed main(){
	int n;
	cin >> n;
	set<int> st;

	for(int i = n;i >= 1;i--){
		if(st.find(i*2) == st.end()){
			st.insert(i);
		}else{
			break;
		}
	}

	int cnt = 0;
	for(auto e : st){
		cout << e;
		if(cnt < st.size()-1){
			cout << " ";
		}
	}

	cout << endl;

	return 0;
}
0