Submission #36406454


Source Code Expand

#include <bits/stdc++.h>
#define st first
#define nd second
#define db double
#define re register
#define pb push_back
#define mk make_pair
#define int long long
#define ldb long double
#define pii pair<int, int>
#define ull unsigned long long
#define mst(a, b) memset(a, b, sizeof(a))
using namespace std;
const int N = 1e5 + 10, INF = 1e16;
inline int read()
{
  int s = 0, w = 1;
  char ch = getchar();
  while(ch < '0' || ch > '9') { if(ch == '-') w *= -1; ch = getchar(); }
  while(ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * w;
}
signed main()
{
  int n = read(), x = read();
  for(re int i = 1; i <= n; i++){
    int y = read();
    if(x == y) printf("%lld\n", i), exit(0);
  }
  return 0;
}
/*
1
10
9 9 4 7 3 10 10 8 4 3
*/

Submission Info

Submission Time
Task A - ^{-1}
User Booksnow
Language C++ (GCC 9.2.1)
Score 100
Code Size 798 Byte
Status AC
Exec Time 2 ms
Memory 3736 KiB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:26:14: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   26 |   for(re int i = 1; i <= n; i++){
      |              ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 10
Set Name Test Cases
Sample example0.txt, example1.txt, example2.txt
All example0.txt, example1.txt, example2.txt, testcase0.txt, testcase1.txt, testcase2.txt, testcase3.txt, testcase4.txt, testcase5.txt, testcase6.txt
Case Name Status Exec Time Memory
example0.txt AC 1 ms 3660 KiB
example1.txt AC 2 ms 3732 KiB
example2.txt AC 2 ms 3660 KiB
testcase0.txt AC 2 ms 3728 KiB
testcase1.txt AC 2 ms 3660 KiB
testcase2.txt AC 2 ms 3488 KiB
testcase3.txt AC 2 ms 3736 KiB
testcase4.txt AC 2 ms 3436 KiB
testcase5.txt AC 2 ms 3620 KiB
testcase6.txt AC 2 ms 3628 KiB