Submission #1610589


Source Code Expand

#include<bits/stdc++.h>
using namespace std;  
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define rep(i,n) for(ll i=0;i<(n);i++)  
#define pii pair<int,int>
#define piii pair<int,pii>
#define mp make_pair
#define pb push_back  
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second  
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-5;
const double PI = M_PI;  
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
#define SHOWARRAY(ar,i,j) REP(a,i)REP(b,j)cerr<<ar[a][b]<<((b==j-1)?((a==i-1)?("\n\n"):("\n")):(" "))
  
#define DIV 1000000007
typedef vector<ll> Array;
typedef vector<Array> matrix;
typedef tuple<int,int,int> tiii;
#define mt make_tuple

vector<set<int>> vs(10001);
int main(){
  int n; cin >> n;
  int ans = 0;
  rep(i,n){
    int t; cin >> t;
    vs[t].insert(i+1);
    if(vs[i+1].find(t) != vs[i+1].end()) ans++;
  }
  cout << ans << endl;
  return 0;
}

Submission Info

Submission Time
Task B - Friendly Rabbits
User cashisu1
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1011 Byte
Status RE
Exec Time 119 ms
Memory 768 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 200
Status
AC × 3
AC × 4
RE × 11
Set Name Test Cases
Sample 0_00.txt, 0_01.txt, 0_02.txt
All 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt
Case Name Status Exec Time Memory
0_00.txt AC 1 ms 768 KB
0_01.txt AC 1 ms 768 KB
0_02.txt AC 1 ms 768 KB
1_00.txt AC 1 ms 768 KB
1_01.txt RE 119 ms 768 KB
1_02.txt RE 97 ms 768 KB
1_03.txt RE 96 ms 768 KB
1_04.txt RE 96 ms 768 KB
1_05.txt RE 97 ms 768 KB
1_06.txt RE 96 ms 768 KB
1_07.txt RE 97 ms 768 KB
1_08.txt RE 97 ms 768 KB
1_09.txt RE 98 ms 768 KB
1_10.txt RE 96 ms 768 KB
1_11.txt RE 96 ms 768 KB