Submission #3974532
Source Code Expand
//inlclude before define #define _USE_MATH_DEFINES //include #include<iostream> #include<string> #include<algorithm> #include<vector> #include<cmath> #include<type_traits> #include<numeric> #include<assert.h> #include<deque> #include<iomanip> #include<set> #include<tuple> #include<map> using namespace std; //typedef typedef vector<int> VI; typedef vector<string> VS; typedef vector<char> VC; typedef pair<int, int> P1; typedef long long int ll; //define #define INF 1e9 #define NUM 1000000007 #define all(x) begin(x),end(x) #define rep(i,n) for(int i=0;i<(int)(n);i++) #define REP(i,a,b) for(int i=int(a);i<int(b);i++) #define chmin(a,b) a=min((a),(b)) #define chmax(a,b) a=max((a),(b)) //function /*ll gcd(ll a, ll b) { if (b == 0) return a; else return gcd(b, a%b); }*/ /*ll lcm(ll a,ll b) { ll g = gcd(a, b); return a * (b / g); }*/ /*int dig(int a) { int sum = 0; while (a) { sum += a % 10; a /= 10; } return sum; }*/ int main() { int n; cin >> n; VI a (n); map<int, int> mp; rep (i, n) { cin >> a[i]; mp[a[i]]++; } int cnt = 0; for (const auto& x : mp) { replace (all (a), x.first, cnt); cnt++; } rep (i, n) { cout << a[i] << endl; } }
Submission Info
Submission Time | |
---|---|
Task | C - 座圧 |
User | mickey_1024 |
Language | C++14 (GCC 5.4.1) |
Score | 30 |
Code Size | 1271 Byte |
Status | TLE |
Exec Time | 2104 ms |
Memory | 5248 KB |
Judge Result
Set Name | Testset1 | Testset2 | All | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 30 / 30 | 0 / 30 | 0 / 40 | ||||||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
Testset1 | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt |
Testset2 | 000.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.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, 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 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
000.txt | AC | 1 ms | 256 KB |
001.txt | AC | 4 ms | 256 KB |
002.txt | AC | 4 ms | 256 KB |
003.txt | AC | 4 ms | 256 KB |
004.txt | AC | 4 ms | 256 KB |
005.txt | AC | 4 ms | 256 KB |
006.txt | AC | 3 ms | 256 KB |
007.txt | AC | 4 ms | 256 KB |
008.txt | AC | 3 ms | 256 KB |
009.txt | AC | 4 ms | 256 KB |
010.txt | TLE | 2103 ms | 2560 KB |
011.txt | AC | 220 ms | 1024 KB |
012.txt | TLE | 2094 ms | 2560 KB |
013.txt | AC | 828 ms | 1536 KB |
014.txt | TLE | 2103 ms | 3456 KB |
015.txt | AC | 1928 ms | 2432 KB |
016.txt | AC | 904 ms | 1664 KB |
017.txt | TLE | 2103 ms | 3328 KB |
018.txt | TLE | 2103 ms | 3200 KB |
019.txt | TLE | 2103 ms | 2688 KB |
020.txt | TLE | 2104 ms | 5248 KB |
021.txt | TLE | 2103 ms | 3456 KB |
022.txt | AC | 1020 ms | 1664 KB |
023.txt | TLE | 2104 ms | 4608 KB |
024.txt | TLE | 2103 ms | 4736 KB |
025.txt | AC | 555 ms | 1408 KB |
026.txt | AC | 1573 ms | 2176 KB |
027.txt | TLE | 2103 ms | 3840 KB |
028.txt | AC | 1443 ms | 2048 KB |
029.txt | TLE | 2104 ms | 5120 KB |