/ SeriousOJ /

Record Detail

Compile Error

foo.cc: In function 'int main()':
foo.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin>>t;
      |     ^~~
foo.cc:6:5: error: 'vector' was not declared in this scope
    6 |     vector<int>arr(n);
      |     ^~~~~~
foo.cc:6:12: error: expected primary-expression before 'int'
    6 |     vector<int>arr(n);
      |            ^~~
foo.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int>ar2(n);
      |            ^~~
foo.cc:11:14: error: 'arr' was not declared in this scope
   11 |         cin>>arr[i];
      |              ^~~
foo.cc:12:14: error: 'ar2' was not declared in this scope
   12 |         cin>>ar2[i];
      |              ^~~
foo.cc:15:5: error: 'cout' was not declared in this scope
   15 |     cout<<min(arr.size(),ar2.size());
      |     ^~~~
foo.cc:15:15: error: 'arr' was not declared in this scope
   15 |     cout<<min(arr.size(),ar2.size());
      |               ^~~
foo.cc:15:26: error: 'ar2' was not declared in this scope
   15 |     cout<<min(arr.size(),ar2.size());
      |                          ^~~
foo.cc:15:11: error: 'min' was not declared in this scope; did you mean 'main'?
   15 |     cout<<min(arr.size(),ar2.size());
      |           ^~~
      |           main

Code

int main(){
    int t;
    cin>>t;
    int n;
    cin >>n;
    vector<int>arr(n);
    vector<int>ar2(n);

    for(int i=0 ;i<n;i++){

        cin>>arr[i];
        cin>>ar2[i];

    }
    cout<<min(arr.size(),ar2.size());

}

Information

Submit By
Type
Submission
Problem
P1224 Maximize the max
Contest
LUCC Presents Kick & Code Intra LU Programming Contest
Language
C++11 (G++ 13.2.0)
Submit At
2025-09-01 07:27:00
Judged At
2025-09-01 07:27:00
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes