AtCoder Beginner Contest 036

Submission #1691511

Source codeソースコード

#include <bits/stdc++.h>
#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define RREP(i,a,b) for(int i=(a);i>=(b);i--)
typedef long long ll; typedef long double ld;
using namespace std;
const int INF=1e9, MOD=1e9+7, around[]={0,1,1,-1,0,-1,1,0,0};
const ld PI=abs(acos(-1));
int n,k,a[100010];
set<int> st;
map<int,int> mp;

int main(){
	cin >> n;
	REP(i,0,n) cin >> a[i],st.insert(a[i]);
	int c=0;
	for(auto s:st) mp[s]=c,c++;
	REP(i,0,n) cout << mp[a[i]] << endl;
	return 0;
}

Submission

Task問題 C - 座圧
User nameユーザ名 ecasdqina
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 AC
Score得点 100
Source lengthソースコード長 494 Byte
File nameファイル名
Exec time実行時間 305 ms
Memory usageメモリ使用量 10368 KB

Test case

Set

Set name Score得点 / Max score Cases
Testset1 30 / 30 000.txt,001.txt,002.txt,003.txt,004.txt,005.txt,006.txt,007.txt,008.txt,009.txt
Testset2 30 / 30 000.txt,010.txt,011.txt,012.txt,013.txt,014.txt,015.txt,016.txt,017.txt,018.txt,019.txt
All 40 / 40 000.txt,001.txt,002.txt,003.txt,004.txt,005.txt,006.txt,007.txt,008.txt,009.txt,010.txt,011.txt,012.txt,013.txt,014.txt,015.txt,016.txt,017.txt,018.txt,019.txt,020.txt,021.txt,022.txt,023.txt,024.txt,025.txt,026.txt,027.txt,028.txt,029.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
000.txt AC 1 ms 256 KB
001.txt AC 4 ms 256 KB
002.txt AC 4 ms 384 KB
003.txt AC 4 ms 384 KB
004.txt AC 4 ms 384 KB
005.txt AC 4 ms 256 KB
006.txt AC 4 ms 256 KB
007.txt AC 4 ms 384 KB
008.txt AC 3 ms 256 KB
009.txt AC 4 ms 384 KB
010.txt AC 262 ms 5120 KB
011.txt AC 211 ms 1024 KB
012.txt AC 251 ms 3968 KB
013.txt AC 229 ms 2048 KB
014.txt AC 263 ms 6784 KB
015.txt AC 246 ms 3712 KB
016.txt AC 238 ms 2176 KB
017.txt AC 260 ms 6528 KB
018.txt AC 266 ms 6272 KB
019.txt AC 252 ms 5376 KB
020.txt AC 305 ms 10368 KB
021.txt AC 283 ms 7040 KB
022.txt AC 248 ms 2304 KB
023.txt AC 294 ms 9216 KB
024.txt AC 302 ms 9472 KB
025.txt AC 246 ms 1664 KB
026.txt AC 254 ms 3072 KB
027.txt AC 287 ms 7680 KB
028.txt AC 251 ms 2944 KB
029.txt AC 299 ms 10240 KB