AtCoder Beginner Contest 036

Submission #2550360

Source codeソースコード

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
ll MAX_N = 100005;

int main() {
  ll n;
  ll a[MAX_N];
  map<ll, ll> mp;
  scanf("%lld", &n);
  for (ll i=0; i<n; i++) {
    scanf("%lld", &a[i]);
    mp[a[i]] = 0;
  }
  
  int i=0;
  for (auto x:mp) {
    mp[x.first] = i;
    i++;
  }

  for (ll i=0; i<n; i++) {
    printf("%lld\n", mp[a[i]]);
  }

  return 0;
}

Submission

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

Compiler messageコンパイルメッセージ

./Main.cpp: In function ‘int main()’:
./Main.cpp:11:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld", &n);
^
./Main.cpp:13:25: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld", &a[i]);
^

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 2 ms 256 KB
002.txt AC 2 ms 256 KB
003.txt AC 2 ms 256 KB
004.txt AC 2 ms 256 KB
005.txt AC 2 ms 256 KB
006.txt AC 1 ms 256 KB
007.txt AC 2 ms 256 KB
008.txt AC 1 ms 256 KB
009.txt AC 2 ms 256 KB
010.txt AC 67 ms 4096 KB
011.txt AC 29 ms 1408 KB
012.txt AC 61 ms 3456 KB
013.txt AC 48 ms 2176 KB
014.txt AC 75 ms 5248 KB
015.txt AC 60 ms 3200 KB
016.txt AC 49 ms 2176 KB
017.txt AC 75 ms 5120 KB
018.txt AC 72 ms 4992 KB
019.txt AC 68 ms 4352 KB
020.txt AC 89 ms 7680 KB
021.txt AC 78 ms 5376 KB
022.txt AC 53 ms 2304 KB
023.txt AC 86 ms 6912 KB
024.txt AC 86 ms 9088 KB
025.txt AC 45 ms 1792 KB
026.txt AC 59 ms 2816 KB
027.txt AC 81 ms 5888 KB
028.txt AC 58 ms 2688 KB
029.txt AC 89 ms 7680 KB