Submission #940723

#TimeUsernameProblemLanguageResultExecution timeMemory
940723shenfe1Art Class (IOI13_artclass)C++17
8 / 100
44 ms3656 KiB
#include <bits/stdc++.h> #pragma optimize("Ofast") #pragma target("avx2") using namespace std; #define ll long long #define ld long double #define pb push_back #define pf push_front #define pii pair<int,int> #define all(v) v.begin(),v.end() #define F first #define S second #define mem(a,i) memset(a,i,sizeof(a)) #define sz(s) (int)s.size() #define y1 yy #define ppb pop_back #define lb lower_bound #define ub upper_bound #define gcd(a,b) __gcd(a,b) #define in insert // #define int ll const int MAX=500+15; const ll inf=1e9; const int mod=1e9+7; const int mod1=1e9+9; const ld eps=1e-9; int dx[8]={1,0,-1,0,1,-1,-1,1}; int dy[8]={0,1,0,-1,1,-1,1,-1}; int binpow(int a,int n){ if(!n)return 1; if(n%2==1)return a*binpow(a,n-1); int k=binpow(a,n/2); return k*k; } #include "artclass.h" int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { ld sum=0; for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ if(i)sum+=abs(R[i][j]-R[i-1][j])+abs(G[i][j]-G[i-1][j])+abs(B[i][j]-B[i-1][j]); if(j)sum+=abs(R[i][j]-R[i][j-1])+abs(G[i][j]-G[i][j-1])+abs(B[i][j]-B[i][j-1]); if(i&&j)sum+=abs(R[i][j]-R[i-1][j-1])+abs(G[i][j]-G[i-1][j-1])+abs(B[i][j]-B[i-1][j-1]); } } sum/=(W*(H-1)+H*(W-1)); // cout<<sum<<"\n"; if(sum<=51)return 4; if(sum>=188)return 3; sum=0; for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ sum+=R[i][j]+G[i][j]+B[i][j]; } } sum/=H*W; // cout<<sum<<"\n"; if(sum<=334)return 2; return 1; }

Compilation message (stderr)

artclass.cpp:3: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
    3 | #pragma optimize("Ofast")
      | 
artclass.cpp:4: warning: ignoring '#pragma target ' [-Wunknown-pragmas]
    4 | #pragma target("avx2")
      |
#Verdict Execution timeMemoryGrader output
Fetching results...