#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<unordered_set>
#include<unordered_map>
#include"bubblesort2.h"
#pragma gcc optimize("O3")
#pragma gcc optimize("unroll-loops")
#pragma gcc target("avx2,see4")
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define chmax(a,b) a=max(a,b)
#define chmin(a,b) a=min(a,b)
#define all(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
#define mad(a,b) a=(a+b)%mod
ll solve(vll a){
ll n=a.size(),ans=0;
while(1){
bool done=0;
for(int i=0;i<=n-2;i++){
if(a[i]>a[i+1]){
swap(a[i],a[i+1]);
done=1;
}
}
if(!done)break;
ans++;
}
return ans;
}
vll countScans(vll a,vll x,vll v){
ll n=a.size(),q=x.size();
if(n>2000)return a;
vll fans;
rep(k,q){
a[x[k]]=v[k];
fans.push_back(solve(a));
}
return fans;
}
/*int main(){
ll n,q;
cin>>n>>q;
vll a(n),x(q),v(q);
rep(i,n)cin>>a[i];
rep(i,q)cin>>x[i]>>v[i];
vll res=countScans(a,x,v);
for(auto t:res)cout<<t<<endl;
}
*/
Compilation message
bubblesort2.cpp:9:0: warning: ignoring #pragma gcc optimize [-Wunknown-pragmas]
#pragma gcc optimize("O3")
bubblesort2.cpp:10:0: warning: ignoring #pragma gcc optimize [-Wunknown-pragmas]
#pragma gcc optimize("unroll-loops")
bubblesort2.cpp:11:0: warning: ignoring #pragma gcc target [-Wunknown-pragmas]
#pragma gcc target("avx2,see4")
/tmp/ccwjxpsg.o: In function `main':
grader.cpp:(.text.startup+0x12b): undefined reference to `countScans(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status