제출 #499992

#제출 시각아이디문제언어결과실행 시간메모리
499992dostigatorChessboard (IZhO18_chessboard)C++17
0 / 100
1 ms324 KiB
// author : lox #pragma GCC optimize("O3") #pragma GCC target("popcnt") #include <bits/stdc++.h> using namespace std; #define IZhO_SILVER ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define popcnt __builtin_popcount #define all(a) a.begin(),a.end() #define low_b lower_bound #define up_b upper_bound #define vii vector<pair<ll,ll>> #define vll vector<pair<ll,ll>> #define pii pair<ll,ll> #define mii map<ll,ll> #define pll pair<ll,ll> #define mll map<ll,ll> #define vi vector<ll> #define vl vector<ll> #define pb push_back #define endl '\n' #define Y second #define X first typedef long double ld; typedef long long ll; const long long dx[4]={1,-1,0,0},dy[4]={0,0,1,-1},col=107,N=1e6+777; const ll mod=1e9+7,inf=1e18; void fre_open(){freopen("file.in","r",stdin);freopen("file.out","w",stdout);} ll binpow(ll n,ll k){if(k<0)return 0ll;if(k==0)return 1ll;if(k%2)return (binpow(n,k-1)*n)%mod;ll kk=binpow(n,k/2)%mod;return (kk*kk)%mod;} void solve(){ int n,k; cin>>n>>k; if(n%2==0){ cout<<(n/2)*n<<endl; return; } int res=((n/2+1)*(n/2))*2; for(int i=2; i<n; ++i){ if(n%i)continue; int m=n/i; res=min(res,(m/2+1)*(m/2)*2*i*i); } cout<<res<<endl; } int main() { //fre_open(); IZhO_SILVER; ll tt=1; //cin>>tt; while(tt--) solve(); }

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

chessboard.cpp: In function 'void fre_open()':
chessboard.cpp:27:24: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   27 | void fre_open(){freopen("file.in","r",stdin);freopen("file.out","w",stdout);}
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~
chessboard.cpp:27:53: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   27 | void fre_open(){freopen("file.in","r",stdin);freopen("file.out","w",stdout);}
      |                                              ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...