結果

問題 No.1114 足し算盆に返らず
ユーザー Y17
提出日時 2020-07-17 21:44:51
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 20 ms / 2,000 ms
コード長 523 bytes
コンパイル時間 1,598 ms
コンパイル使用メモリ 171,276 KB
実行使用メモリ 5,760 KB
最終ジャッジ日時 2024-11-29 22:58:11
合計ジャッジ時間 17,477 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

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