제출 #781962

#제출 시각아이디문제언어결과실행 시간메모리
781962Lyrically선물상자 (IOI15_boxes)C++17
20 / 100
1 ms212 KiB
#include<bits/stdc++.h> using namespace std; #define pii pair<int,int> #define pb push_back #define rep(i,n) for(int i=0;i<n;i++) #define rep1(i,n) for(int i=1;i<=n;i++) int read(){int x;scanf("%d",&x);return x;} void print(int x){printf("%d\n",x);} const int mod=1000000007; long long delivery(int n,int k,int l,int p[]) { long long res=0; for(int i=0;i<n;i+=k) { vector<int> v; for(int j=i;j<=min(i+k-1,n-1);j++){v.pb(p[j]);} int tmp=l; int ldis=0,rdis=0; for(auto x:v) { if(x<=l-x){ldis=max(ldis,x);} else{rdis=max(rdis,l-x);} } tmp=min(tmp,2*(ldis+rdis)); res+=tmp; } return res; }

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

boxes.cpp: In function 'int read()':
boxes.cpp:7:23: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 | int read(){int x;scanf("%d",&x);return x;}
      |                  ~~~~~^~~~~~~~~
#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...