提出 #41941341
ソースコード 拡げる
#include <bits/stdc++.h>
using namespace std;
signed main() {
int n;
cin>>n;
string s[n];
int a[n];
for(int i=0;i<n;i++){
cin>>s[i]>>a[i];
}
for(int i=0;i<n;i++){
//cout<<i<<" "<<s[i]<<" "<<a[i]<<endl;
}
int mina=0;
int minage=10e9;
int cur=-1;
for(int i=0;i<n;i++){
if(a[i]<minage){
cur=i;
minage=a[i];
}
}
//cout<<cur<<endl;
for(int i=cur;i<n;i++){
cout<<s[i]<<endl;
}
for(int i=0;i<cur;i++){
cout<<s[i]<<endl;
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | A - First Player |
| ユーザ | chacoder |
| 言語 | C++ (GCC 9.2.1) |
| 得点 | 100 |
| コード長 | 527 Byte |
| 結果 | AC |
| 実行時間 | 7 ms |
| メモリ | 3604 KiB |
コンパイルエラー
./Main.cpp: In function ‘int main()’:
./Main.cpp:16:14: warning: overflow in conversion from ‘double’ to ‘int’ changes value from ‘1.0e+10’ to ‘2147483647’ [-Woverflow]
16 | int minage=10e9;
| ^~~~
./Main.cpp:15:7: warning: unused variable ‘mina’ [-Wunused-variable]
15 | int mina=0;
| ^~~~
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 100 / 100 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | example0.txt, example1.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, example0.txt, example1.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 000.txt | AC | 7 ms | 3412 KiB |
| 001.txt | AC | 2 ms | 3548 KiB |
| 002.txt | AC | 2 ms | 3556 KiB |
| 003.txt | AC | 4 ms | 3552 KiB |
| 004.txt | AC | 2 ms | 3404 KiB |
| 005.txt | AC | 2 ms | 3528 KiB |
| 006.txt | AC | 2 ms | 3504 KiB |
| 007.txt | AC | 2 ms | 3412 KiB |
| 008.txt | AC | 2 ms | 3604 KiB |
| 009.txt | AC | 2 ms | 3600 KiB |
| 010.txt | AC | 2 ms | 3420 KiB |
| 011.txt | AC | 2 ms | 3556 KiB |
| example0.txt | AC | 2 ms | 3556 KiB |
| example1.txt | AC | 2 ms | 3404 KiB |