Submission #645583

#TimeUsernameProblemLanguageResultExecution timeMemory
645583TimDeePresent (RMI21_present)C++17
8 / 100
1 ms468 KiB
#include <bits/stdc++.h>
using namespace std;
#define forn(i,n) for (int i=0;i<n;++i)
#define prn {cout<<"NO\n";return;}
#define pry cout<<"YES\n";

vector<vector<int>> a;

void solve() {
	
	int k; cin>>k;
	
	cout<<a[k].size()<<' ';
	for (auto x:a[k]) cout<<x<<' '; cout<<'\n';

}

int32_t main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	a={{},{1},{2},{1,2}};

	int mx=3;
	while (a.size()<=100) {
		vector<vector<int>> b;
		for (auto x:a) {
			vector<int> y;
			int scuza=1;
			for (auto v:x) {
				int k=__gcd(v,mx);
				//cout<<v<<' '<<mx<<' '<<k<<' ';
				int paiu=0;
				for (auto u:x) paiu|=u==k;
				scuza&=paiu;
				//cout<<paiu<<"  ";
			}
			y=x;
			y.push_back(mx);
			if (scuza) b.push_back(y);
		}
		for (auto x:b) a.push_back(x);
		++mx;
	}

	int t; cin>>t;
	while (t--) solve();
	return 0;
}

Compilation message (stderr)

Main.cpp: In function 'void solve()':
Main.cpp:14:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   14 |  for (auto x:a[k]) cout<<x<<' '; cout<<'\n';
      |  ^~~
Main.cpp:14:34: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   14 |  for (auto x:a[k]) cout<<x<<' '; cout<<'\n';
      |                                  ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...