답안 #991656

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
991656 2024-06-02T18:02:28 Z Abito Present (RMI21_present) C++17
8 / 100
37 ms 1480 KB
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define ppb pop_back
#define ep insert
#define endl '\n'
#define elif else if
#define pow pwr
#define sqrt sqrtt
#define int long long
#define y1 YONE
typedef unsigned long long ull;
using namespace std;
vector<vector<int>> S;
bool cmp(vector<int> x,vector<int> y){
    for (int i=1;(int)min(x.size(),y.size())-i>=0;i++){
        if (x[x.size()-i]!=y[y.size()-i]) return x[x.size()-i]<y[y.size()-i];
    }
    return x.size()<y.size();
}
int32_t main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    int x=0;
    //cout<<(1<<20)<<endl;
    for (int i=0;i<(1<<15);i++){
        set<int> s;
        for (int j=1;j<=15;j++){
            if (i&(1<<(j-1))) s.ep(j);
        }
        bool ok=true;
        for (auto u:s) for (auto v:s) ok&=s.count(__gcd(u,v));
        if (!ok) continue;
        vector<int> v;
        for (auto u:s) v.pb(u);
        S.pb(v);
    }
    sort(S.begin(),S.end(),cmp);
    int t;cin>>t;
    while (t--){
        int k;cin>>k;
        cout<<S[k].size()<<' ';
        for (auto u:S[k]) cout<<u<<' ';cout<<endl;
    }
    return 0;
}

Compilation message

Main.cpp: In function 'int32_t main()':
Main.cpp:43:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   43 |         for (auto u:S[k]) cout<<u<<' ';cout<<endl;
      |         ^~~
Main.cpp:43:40: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   43 |         for (auto u:S[k]) cout<<u<<' ';cout<<endl;
      |                                        ^~~~
Main.cpp:24:9: warning: unused variable 'x' [-Wunused-variable]
   24 |     int x=0;
      |         ^
# 결과 실행 시간 메모리 Grader output
1 Correct 36 ms 860 KB Output is correct
2 Correct 36 ms 860 KB Output is correct
3 Correct 37 ms 960 KB Output is correct
4 Correct 36 ms 980 KB Output is correct
5 Correct 36 ms 968 KB Output is correct
6 Correct 37 ms 860 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 36 ms 860 KB Output is correct
2 Correct 36 ms 860 KB Output is correct
3 Correct 37 ms 960 KB Output is correct
4 Correct 36 ms 980 KB Output is correct
5 Correct 36 ms 968 KB Output is correct
6 Correct 37 ms 860 KB Output is correct
7 Runtime error 37 ms 1480 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 36 ms 860 KB Output is correct
2 Correct 36 ms 860 KB Output is correct
3 Correct 37 ms 960 KB Output is correct
4 Correct 36 ms 980 KB Output is correct
5 Correct 36 ms 968 KB Output is correct
6 Correct 37 ms 860 KB Output is correct
7 Runtime error 37 ms 1480 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 36 ms 860 KB Output is correct
2 Correct 36 ms 860 KB Output is correct
3 Correct 37 ms 960 KB Output is correct
4 Correct 36 ms 980 KB Output is correct
5 Correct 36 ms 968 KB Output is correct
6 Correct 37 ms 860 KB Output is correct
7 Runtime error 37 ms 1480 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 36 ms 860 KB Output is correct
2 Correct 36 ms 860 KB Output is correct
3 Correct 37 ms 960 KB Output is correct
4 Correct 36 ms 980 KB Output is correct
5 Correct 36 ms 968 KB Output is correct
6 Correct 37 ms 860 KB Output is correct
7 Runtime error 37 ms 1480 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -