제출 #525964

#제출 시각아이디문제언어결과실행 시간메모리
525964SlavitaSet (COCI21_set)C++14
0 / 110
14 ms3024 KiB
#include <bits/stdc++.h> #pragma optimize("O3") #pragma GCC optimize("-O3") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC optimize("fast-math") #include <ext/pb_ds/assoc_container.hpp> #define ve vector<int> #define pb push_back #define mp make_pair #define fi first #define se second #define pi pair<int,int> #define all(v) v.begin(),v.end() #define si(v) (int)v.size() #define en '\n' #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> #define ordered_muiltiset tree<int, null_type,less_equal<>, rb_tree_tag,tree_order_statistics_node_update> using namespace std; using namespace __gnu_pbds; typedef long long ll; typedef unsigned long long ull; const int N = 1e4 + 228; const int big = 1e9; const ll llbig = 1e18 + 228; //ordered_set os; // os.order_of_key(4), (*os.find_by_order(5)) int n, m, k; string a[N]; gp_hash_table<string, int> mem; gp_hash_table<string, bool> ans; bool getbit(int x, int bit){ bit--; return (x & (1 << bit)) == (1 << bit); } int main(){ cin >> n >> k; for (int i = 1; i <= n; i++){ cin >> a[i]; mem[a[i]] = i; /*for (int mask = 0; mask <= (1 << (k + 1)); mask++){ for (int j = 1; j <= k; j++){ if (getbit(mask, j)){ if (a[i][j] == 1) str += "q"; if (a[i][j] == 2) str += "w"; if (a[i][j] == 3) str += "e"; }else{ if (a[i][j] == 1) str += "1"; if (a[i][j] == 2) str += "2"; if (a[i][j] == 3) str += "3"; } } }*/ } for (int x = 1; x <= n; x++){ for (int y = x + 1; y <= n; y++){ string str = ""; for (int i = 0; i < k; i++){ if (a[x][i] == a[y][i]){ str += a[x][i]; } if (a[x][i] != a[y][i]){ char c1 = a[x][i]; if ((int)a[x][i] > (int)a[y][i]) c1 = a[y][i]; char c2 = a[x][i]; if ((int)a[x][i] < (int)a[y][i]) c2 = a[y][i]; if (c1 == '2' && c2 == '3') str += "1"; if (c1 == '1' && c2 == '3') str += "2"; if (c1 == '1' && c2 == '2') str += "3"; } } if (mem[str]) { ve v; v.pb(x); v.pb(y); v.pb(mem[str]); sort(all(v)); ans[to_string(v[0]) + "" + to_string(v[1]) + "" + to_string(v[2])] = 1; } } } cout << si(ans); return 0; } /* */

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp:2: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
    2 | #pragma optimize("O3")
      |
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...