Submission #645600

# Submission time Handle Problem Language Result Execution time Memory
645600 2022-09-27T12:31:55 Z TimDee Present (RMI21_present) C++17
29 / 100
1299 ms 391424 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";

//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast")

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()<=1000000) {
		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:17:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   17 |  for (auto x:a[k]) cout<<x<<' '; cout<<'\n';
      |  ^~~
Main.cpp:17:34: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   17 |  for (auto x:a[k]) cout<<x<<' '; cout<<'\n';
      |                                  ^~~~
# Verdict Execution time Memory Grader output
1 Correct 1137 ms 209252 KB Output is correct
2 Correct 1140 ms 209232 KB Output is correct
3 Correct 1147 ms 209176 KB Output is correct
4 Correct 1156 ms 209300 KB Output is correct
5 Correct 1143 ms 209200 KB Output is correct
6 Correct 1165 ms 209212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1137 ms 209252 KB Output is correct
2 Correct 1140 ms 209232 KB Output is correct
3 Correct 1147 ms 209176 KB Output is correct
4 Correct 1156 ms 209300 KB Output is correct
5 Correct 1143 ms 209200 KB Output is correct
6 Correct 1165 ms 209212 KB Output is correct
7 Correct 1152 ms 209344 KB Output is correct
8 Correct 1163 ms 209128 KB Output is correct
9 Correct 1125 ms 209212 KB Output is correct
10 Correct 1172 ms 209220 KB Output is correct
11 Correct 1159 ms 209388 KB Output is correct
12 Correct 1146 ms 209232 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1137 ms 209252 KB Output is correct
2 Correct 1140 ms 209232 KB Output is correct
3 Correct 1147 ms 209176 KB Output is correct
4 Correct 1156 ms 209300 KB Output is correct
5 Correct 1143 ms 209200 KB Output is correct
6 Correct 1165 ms 209212 KB Output is correct
7 Correct 1152 ms 209344 KB Output is correct
8 Correct 1163 ms 209128 KB Output is correct
9 Correct 1125 ms 209212 KB Output is correct
10 Correct 1172 ms 209220 KB Output is correct
11 Correct 1159 ms 209388 KB Output is correct
12 Correct 1146 ms 209232 KB Output is correct
13 Runtime error 1299 ms 391424 KB Execution killed with signal 11
14 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1137 ms 209252 KB Output is correct
2 Correct 1140 ms 209232 KB Output is correct
3 Correct 1147 ms 209176 KB Output is correct
4 Correct 1156 ms 209300 KB Output is correct
5 Correct 1143 ms 209200 KB Output is correct
6 Correct 1165 ms 209212 KB Output is correct
7 Correct 1152 ms 209344 KB Output is correct
8 Correct 1163 ms 209128 KB Output is correct
9 Correct 1125 ms 209212 KB Output is correct
10 Correct 1172 ms 209220 KB Output is correct
11 Correct 1159 ms 209388 KB Output is correct
12 Correct 1146 ms 209232 KB Output is correct
13 Runtime error 1299 ms 391424 KB Execution killed with signal 11
14 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1137 ms 209252 KB Output is correct
2 Correct 1140 ms 209232 KB Output is correct
3 Correct 1147 ms 209176 KB Output is correct
4 Correct 1156 ms 209300 KB Output is correct
5 Correct 1143 ms 209200 KB Output is correct
6 Correct 1165 ms 209212 KB Output is correct
7 Correct 1152 ms 209344 KB Output is correct
8 Correct 1163 ms 209128 KB Output is correct
9 Correct 1125 ms 209212 KB Output is correct
10 Correct 1172 ms 209220 KB Output is correct
11 Correct 1159 ms 209388 KB Output is correct
12 Correct 1146 ms 209232 KB Output is correct
13 Runtime error 1299 ms 391424 KB Execution killed with signal 11
14 Halted 0 ms 0 KB -