結果
| 問題 | No.2092 Conjugation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-14 14:01:11 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 11 ms / 2,000 ms |
| コード長 | 425 bytes |
| 記録 | |
| コンパイル時間 | 3,899 ms |
| コンパイル使用メモリ | 179,040 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-13 05:29:37 |
| 合計ジャッジ時間 | 4,130 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:25:18: warning: 'n' may be used uninitialized [-Wmaybe-uninitialized]
25 | for(i=n;i>=1;i--) a[i]+=a[i+1];
| ~^~~
main.cpp:16:15: note: 'n' was declared here
16 | int N,n;
| ^
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<int(n);i++)
typedef long long ll;
typedef pair<int,int> P;
int a[100010];
int main(void){
int i;
cin.tie(0); ios_base::sync_with_stdio(false);
int N,n;
cin >> N;
for(i=1;i<=N;i++){
int x;
cin >> x;
if(i==1) n=x;
a[x]++;
}
for(i=n;i>=1;i--) a[i]+=a[i+1];
for(i=1;i<=n;i++) cout << a[i] << ' ';
cout << endl;
return 0;
}