Submission #645583

# Submission time Handle Problem Language Result Execution time Memory
645583 2022-09-27T11:28:35 Z TimDee Present (RMI21_present) C++17
8 / 100
1 ms 468 KB
#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

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 time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 328 KB Output is correct
4 Correct 1 ms 328 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 328 KB Output is correct
4 Correct 1 ms 328 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Runtime error 1 ms 468 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 328 KB Output is correct
4 Correct 1 ms 328 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Runtime error 1 ms 468 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 328 KB Output is correct
4 Correct 1 ms 328 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Runtime error 1 ms 468 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 328 KB Output is correct
4 Correct 1 ms 328 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Runtime error 1 ms 468 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -