제출 #987421

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
9874212024-05-22 18:06:33user736482Cheerleaders (info1cup20_cheerleaders)C++17
72 / 100
122 ms3012 KiB
#include<bits/stdc++.h>
using namespace std;
int n,a,b,c,mini=2147000000;
string res,resak;
vector<int>v;
map<int,int>mp;
pair<string,int> solve(vector<int>v2){
string odp="";
int odpint=0;
for(int i=0;i<n;i++){
int licz[1<<i+1];
for(int j=0;j<1<<i+1;j++)
licz[j]=0;
int wyn=0,wyn2=0;
for(int j=0;j<(int)v2.size();j++){
int smth = v2[j]>>n-i-1;
if(smth%2==0)
wyn+=licz[smth+1];
if(smth%2==1)
wyn2+=licz[smth-1];
licz[smth]++;
}
//cout<<wyn<<" "<<wyn2<<" ";
if(wyn>wyn2){
odp.push_back('1');
}
odpint+=min(wyn,wyn2);
for(int j=1;j<n;j++)
odp.push_back('2');
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

cheerleaders.cpp: In function 'std::pair<std::__cxx11::basic_string<char>, int> solve(std::vector<int>)':
cheerleaders.cpp:12:22: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
   12 |         int licz[1<<i+1];
      |                     ~^~
cheerleaders.cpp:13:27: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
   13 |         for(int j=0;j<1<<i+1;j++)
      |                          ~^~
cheerleaders.cpp:17:34: warning: suggest parentheses around '-' inside '>>' [-Wparentheses]
   17 |             int smth = v2[j]>>n-i-1;
      |                               ~~~^~
cheerleaders.cpp: In function 'int main()':
cheerleaders.cpp:66:26: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   66 |             v[j]+=smth<<n-1;
      |                         ~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...