Submission #00088


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int n;
int d[200005];
int ushi=0;
int uku=0;
int main(){
scanf(" %d",&n);
for(int i=0;i<n;i++){
scanf(" %d",&d[i]);
}
sort(d,d+n,greater<int>());
for(int i=0;i<n;i++){
if(i%2==0){
ushi+=d[i];
}else{
uku+=d[i];
}
}
if(ushi>uku){
cout << "ushi" << endl;
}else if(ushi<uku){
cout << "uku" << endl;
}else{
cout << "draw" << endl;
}
return 0;
}

ステータス

項目 データ
問題 0003 - うし
ユーザー名 Xyca.
投稿日時 2017-01-10 16:23:08
言語 C++11
状態 Accepted
得点 125
ソースコード長 529 Byte
最大実行時間 134 ms
最大メモリ使用量 8752 KB

セット

セット 得点 Cases
1 ALL 125 / 125 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
01_sample1.txt AC 34 ms 480 KB
1
01_sample2.txt AC 26 ms 460 KB
1
02_handmake1.txt AC 26 ms 440 KB
1
02_handmake2.txt AC 23 ms 676 KB
1
02_handmake3.txt AC 19 ms 656 KB
1
03_random1.txt AC 134 ms 2048 KB
1
03_random2.txt AC 68 ms 2912 KB
1
03_random3.txt AC 57 ms 3652 KB
1
04_random1.txt AC 43 ms 3620 KB
1
04_random2.txt AC 72 ms 4868 KB
1
04_random3.txt AC 44 ms 6120 KB
1
05_random1.txt AC 54 ms 7372 KB
1
05_random2.txt AC 79 ms 8752 KB
1
05_random3.txt AC 35 ms 8596 KB
1