답안 #645585

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
645585 2022-09-27T11:29:30 Z TimDee Present (RMI21_present) C++17
29 / 100
1179 ms 391360 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';
      |                                  ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1018 ms 209288 KB Output is correct
2 Correct 1016 ms 209264 KB Output is correct
3 Correct 1008 ms 209244 KB Output is correct
4 Correct 1012 ms 209144 KB Output is correct
5 Correct 990 ms 209164 KB Output is correct
6 Correct 1016 ms 209240 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1018 ms 209288 KB Output is correct
2 Correct 1016 ms 209264 KB Output is correct
3 Correct 1008 ms 209244 KB Output is correct
4 Correct 1012 ms 209144 KB Output is correct
5 Correct 990 ms 209164 KB Output is correct
6 Correct 1016 ms 209240 KB Output is correct
7 Correct 1014 ms 209320 KB Output is correct
8 Correct 1006 ms 209264 KB Output is correct
9 Correct 1022 ms 209104 KB Output is correct
10 Correct 1004 ms 209172 KB Output is correct
11 Correct 1012 ms 209188 KB Output is correct
12 Correct 1010 ms 209208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1018 ms 209288 KB Output is correct
2 Correct 1016 ms 209264 KB Output is correct
3 Correct 1008 ms 209244 KB Output is correct
4 Correct 1012 ms 209144 KB Output is correct
5 Correct 990 ms 209164 KB Output is correct
6 Correct 1016 ms 209240 KB Output is correct
7 Correct 1014 ms 209320 KB Output is correct
8 Correct 1006 ms 209264 KB Output is correct
9 Correct 1022 ms 209104 KB Output is correct
10 Correct 1004 ms 209172 KB Output is correct
11 Correct 1012 ms 209188 KB Output is correct
12 Correct 1010 ms 209208 KB Output is correct
13 Runtime error 1179 ms 391360 KB Execution killed with signal 11
14 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1018 ms 209288 KB Output is correct
2 Correct 1016 ms 209264 KB Output is correct
3 Correct 1008 ms 209244 KB Output is correct
4 Correct 1012 ms 209144 KB Output is correct
5 Correct 990 ms 209164 KB Output is correct
6 Correct 1016 ms 209240 KB Output is correct
7 Correct 1014 ms 209320 KB Output is correct
8 Correct 1006 ms 209264 KB Output is correct
9 Correct 1022 ms 209104 KB Output is correct
10 Correct 1004 ms 209172 KB Output is correct
11 Correct 1012 ms 209188 KB Output is correct
12 Correct 1010 ms 209208 KB Output is correct
13 Runtime error 1179 ms 391360 KB Execution killed with signal 11
14 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1018 ms 209288 KB Output is correct
2 Correct 1016 ms 209264 KB Output is correct
3 Correct 1008 ms 209244 KB Output is correct
4 Correct 1012 ms 209144 KB Output is correct
5 Correct 990 ms 209164 KB Output is correct
6 Correct 1016 ms 209240 KB Output is correct
7 Correct 1014 ms 209320 KB Output is correct
8 Correct 1006 ms 209264 KB Output is correct
9 Correct 1022 ms 209104 KB Output is correct
10 Correct 1004 ms 209172 KB Output is correct
11 Correct 1012 ms 209188 KB Output is correct
12 Correct 1010 ms 209208 KB Output is correct
13 Runtime error 1179 ms 391360 KB Execution killed with signal 11
14 Halted 0 ms 0 KB -