結果
| 問題 |
No.9 モンスターのレベル上げ
|
| ユーザー |
nagakin0414
|
| 提出日時 | 2018-07-06 16:07:01 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 4,474 ms / 5,000 ms |
| コード長 | 1,662 bytes |
| コンパイル時間 | 337 ms |
| コンパイル使用メモリ | 31,872 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-26 02:55:23 |
| 合計ジャッジ時間 | 39,419 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:23:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
23 | scanf("%d",&n);
| ~~~~~^~~~~~~~~
main.cpp:25:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
25 | scanf("%d",a+i);
| ~~~~~^~~~~~~~~~
main.cpp:28:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
28 | scanf("%d",b+i);
| ~~~~~^~~~~~~~~~
ソースコード
/*HeliaRPGQ[ĂBRPGQ[͖̃X^[̃xグĂQ[i߂Q[łB
Helia͎莝NC̃X^[̃p[eB[ăxグƎvĂB
xグ́AG̃X^[11Ő킢AG̃x̔̂ĂlłBi̐X^[̃xɉZj
ႦÃX^[̃x1ő̃X^[̃x5̎A
ƁÃX^[̃x3ɂȂB
킢ɊւĂ̓ACegĂł߁AxɊWȂĂƂB
ŁAG̃X^[~ɎvɕłāAŏɐ키X^[߂Ǝv̏ԂɑSƈx키ƂłꂪB
iŏɐ킦郂X^[͎RɑIׂj
HeliáA̎莝̃X^[̒AP했A̎ɈԃxႢAꍇ́AԐ킢ĂȂX^[킹ƂB
̎̃X^[Sē|ƂāA莝̃p[eB[Ő퓬ԑƂႭȂ悤ōŏɐ키X^[IƂA̒ňԐ퓬߂ĂB*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdbool.h>
#include<math.h>
int main(){
int a[2000],b[2000],t[2000],i,j,k,p,n,m,M;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",a+i);
}
for(i=0;i<n;i++){
scanf("%d",b+i);
}
M=n;
for(i=0;i<n;i++){
for(j=0;j<n;j++){
t[j]=a[j]*2000;
}
for(j=0;j<n;j++){
for(p=k=0;k<n;k++){
if(t[k]<t[p]){
p=k;
}
}
t[p]+=b[(i+j)%n]/2*2000+1;
}
for(m=j=0;j<n;j++){
m=fmax(m,t[j]%2000);
}
if(M>m){
M=m;
}
}
printf("%d",M);
return 0;
}
nagakin0414