제출 #473466

#제출 시각아이디문제언어결과실행 시간메모리
473466Ahmadsm2005Genetics (BOI18_genetics)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define endl '\n' #define modulo 998244353 #define modulo2 998244353 #define eps 0.00000001 //#define int long long #define int __int16 #define PI acos(-1) #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3") //#pragma GCC optimize("trapv") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native") #pragma GCC optimize("-ffast-math") #pragma GCC optimize("-funroll-loops") #pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loops") #define sinDegrees(x) sin((x) * PI / 180.0) #define cosDegrees(x) cos((x) * PI / 180.0) #define tanDegrees(x) tan((x) * PI / 180.0) #define atanDegrees(x) atan(x)* 180.0 / PI #define asinDegrees(x) asin(x)* 180.0 / PI #define EPS 0.000000001 using namespace std; int power(int x,int y,int m=modulo) { if(y<0) return 0; int temp; if(y == 0) return 1; temp = (power(x, y/2,m))%m; if (y%2 == 0) return ((temp%m)*temp)%m; else return ((x*temp%m)*temp%m)%m; } int inv(int x,int m=modulo) { return (power(x,m-2,m))%m; } int n,m,k; bool BAD[4100],GOOD[4100][4100]; string s; vector<int>lolz; bitset<4100>wow[4100]; bitset<4100>wow2[4100]; bitset<4100>TEMP; int32_t main() { cin.tie(0),iostream::sync_with_stdio(0); //freopen("halfnice.in","r",stdin); cin>>n>>m>>k; mt19937 rng(2005); lolz.resize(n); for(int i=0;i<n;i++){ cin>>s; lolz.push_back(i); for(int l=0;l<m;l++){ if(s[l]=='C') wow[i][l]=1; else if(s[l]=='T') wow2[i][l]=1; else if(s[l]=='G') wow[i][l]=1,wow2[i][l]=1; } } while(1){ shuffle(lolz.begin(),lolz.end(),rng); if(BAD[lolz[0]]) continue; for(int i=1;i<n;i++){ if(GOOD[lolz[0]][lolz[i]]) continue; TEMP=wow[lolz[0]]^wow[lolz[i]]; TEMP=(wow2[lolz[0]]^wow2[lolz[i]])|(wow[lolz[0]]^wow[lolz[i]]); if(TEMP.count()!=k){ BAD[lolz[0]]=1,BAD[lolz[i]]=1; goto a; } else GOOD[lolz[0]][lolz[i]]=1,GOOD[lolz[i]][lolz[0]]=1; } cout<<lolz[0]+1<<endl; break; a:; } }

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

genetics.cpp:7:13: error: '__int16' does not name a type; did you mean '__int16_t'?
    7 | #define int __int16
      |             ^~~~~~~
genetics.cpp:22:1: note: in expansion of macro 'int'
   22 | int power(int x,int y,int m=modulo)
      | ^~~
genetics.cpp:7:13: error: '__int16' does not name a type; did you mean '__int16_t'?
    7 | #define int __int16
      |             ^~~~~~~
genetics.cpp:35:1: note: in expansion of macro 'int'
   35 | int inv(int x,int m=modulo)
      | ^~~
genetics.cpp:7:13: error: '__int16' does not name a type; did you mean '__int16_t'?
    7 | #define int __int16
      |             ^~~~~~~
genetics.cpp:39:1: note: in expansion of macro 'int'
   39 | int n,m,k;
      | ^~~
genetics.cpp:7:13: error: '__int16' was not declared in this scope; did you mean '__int16_t'?
    7 | #define int __int16
      |             ^~~~~~~
genetics.cpp:42:8: note: in expansion of macro 'int'
   42 | vector<int>lolz;
      |        ^~~
genetics.cpp:42:11: error: template argument 1 is invalid
   42 | vector<int>lolz;
      |           ^
genetics.cpp:42:11: error: template argument 2 is invalid
genetics.cpp: In function 'int32_t main()':
genetics.cpp:50:6: error: 'n' was not declared in this scope
   50 | cin>>n>>m>>k;
      |      ^
genetics.cpp:50:9: error: 'm' was not declared in this scope
   50 | cin>>n>>m>>k;
      |         ^
genetics.cpp:50:12: error: 'k' was not declared in this scope
   50 | cin>>n>>m>>k;
      |            ^
genetics.cpp:52:6: error: request for member 'resize' in 'lolz', which is of non-class type 'int'
   52 | lolz.resize(n);
      |      ^~~~~~
genetics.cpp:7:13: error: '__int16' was not declared in this scope; did you mean '__int16_t'?
    7 | #define int __int16
      |             ^~~~~~~
genetics.cpp:53:5: note: in expansion of macro 'int'
   53 | for(int i=0;i<n;i++){
      |     ^~~
genetics.cpp:53:13: error: 'i' was not declared in this scope
   53 | for(int i=0;i<n;i++){
      |             ^
genetics.cpp:55:6: error: request for member 'push_back' in 'lolz', which is of non-class type 'int'
   55 | lolz.push_back(i);
      |      ^~~~~~~~~
genetics.cpp:56:9: error: expected ';' before 'l'
   56 | for(int l=0;l<m;l++){
      |         ^
genetics.cpp:56:13: error: 'l' was not declared in this scope
   56 | for(int l=0;l<m;l++){
      |             ^
genetics.cpp:66:14: error: request for member 'begin' in 'lolz', which is of non-class type 'int'
   66 | shuffle(lolz.begin(),lolz.end(),rng);
      |              ^~~~~
genetics.cpp:66:27: error: request for member 'end' in 'lolz', which is of non-class type 'int'
   66 | shuffle(lolz.begin(),lolz.end(),rng);
      |                           ^~~
genetics.cpp:67:12: error: invalid types 'int[int]' for array subscript
   67 | if(BAD[lolz[0]])
      |            ^
genetics.cpp:7:13: error: '__int16' was not declared in this scope; did you mean '__int16_t'?
    7 | #define int __int16
      |             ^~~~~~~
genetics.cpp:69:5: note: in expansion of macro 'int'
   69 | for(int i=1;i<n;i++){
      |     ^~~
genetics.cpp:69:13: error: 'i' was not declared in this scope
   69 | for(int i=1;i<n;i++){
      |             ^
genetics.cpp:70:13: error: invalid types 'int[int]' for array subscript
   70 | if(GOOD[lolz[0]][lolz[i]])
      |             ^
genetics.cpp:72:14: error: invalid types 'int[int]' for array subscript
   72 | TEMP=wow[lolz[0]]^wow[lolz[i]];
      |              ^
genetics.cpp:73:16: error: invalid types 'int[int]' for array subscript
   73 | TEMP=(wow2[lolz[0]]^wow2[lolz[i]])|(wow[lolz[0]]^wow[lolz[i]]);
      |                ^
genetics.cpp:73:45: error: invalid types 'int[int]' for array subscript
   73 | TEMP=(wow2[lolz[0]]^wow2[lolz[i]])|(wow[lolz[0]]^wow[lolz[i]]);
      |                                             ^
genetics.cpp:75:9: error: invalid types 'int[int]' for array subscript
   75 | BAD[lolz[0]]=1,BAD[lolz[i]]=1;
      |         ^
genetics.cpp:79:10: error: invalid types 'int[int]' for array subscript
   79 | GOOD[lolz[0]][lolz[i]]=1,GOOD[lolz[i]][lolz[0]]=1;
      |          ^
genetics.cpp:79:44: error: invalid types 'int[int]' for array subscript
   79 | GOOD[lolz[0]][lolz[i]]=1,GOOD[lolz[i]][lolz[0]]=1;
      |                                            ^
genetics.cpp:81:11: error: invalid types 'int[int]' for array subscript
   81 | cout<<lolz[0]+1<<endl;
      |           ^