提出 #46327825
ソースコード 拡げる
#include<bits/stdc++.h>
using namespace std;
//#define int long long
inline int read(){int x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;
ch=getchar();}while(ch>='0'&&ch<='9'){x=(x<<1)+
(x<<3)+(ch^48);ch=getchar();}return x*f;}
#define Z(x) (x)*(x)
#define pb push_back
//#define M
//#define mo
//#define N
struct node {
int k, id;
}a[500010];
int n, m, i, j, k, T;
char s[500010];
bool cmp(node x, node y) {
if(x.k==y.k) return x.id<y.id;
return x.k>y.k;
}
signed main()
{
// freopen("in.txt", "r", stdin);
// freopen("out.txt", "w", stdout);
// srand(time(NULL));
// T=read();
// while(T--) {
//
// }
n=read();
for(i=1; i<=n; ++i) {
scanf("%s", s+1);
for(j=1; s[j]; ++j)
if(s[j]=='o') a[i].k++;
a[i].id=i;
}
sort(a+1, a+n+1, cmp);
for(i=1; i<=n; ++i) printf("%d ", a[i].id);
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Round-Robin Tournament |
| ユーザ | zhangtingxi |
| 言語 | C++ 20 (gcc 12.2) |
| 得点 | 200 |
| コード長 | 882 Byte |
| 結果 | AC |
| 実行時間 | 1 ms |
| メモリ | 3820 KiB |
コンパイルエラー
Main.cpp: In function ‘int main()’:
Main.cpp:35:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
35 | scanf("%s", s+1);
| ~~~~~^~~~~~~~~~~
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_01.txt, 00_sample_02.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample_01.txt | AC | 1 ms | 3684 KiB |
| 00_sample_02.txt | AC | 1 ms | 3644 KiB |
| 01_test_01.txt | AC | 1 ms | 3816 KiB |
| 01_test_02.txt | AC | 1 ms | 3600 KiB |
| 01_test_03.txt | AC | 1 ms | 3680 KiB |
| 01_test_04.txt | AC | 1 ms | 3684 KiB |
| 01_test_05.txt | AC | 1 ms | 3816 KiB |
| 01_test_06.txt | AC | 1 ms | 3820 KiB |
| 01_test_07.txt | AC | 1 ms | 3620 KiB |
| 01_test_08.txt | AC | 1 ms | 3692 KiB |
| 01_test_09.txt | AC | 1 ms | 3760 KiB |
| 01_test_10.txt | AC | 1 ms | 3620 KiB |