Submission #1249062

#TimeUsernameProblemLanguageResultExecution timeMemory
1249062bethanceStar triangles (IZhO11_triangle)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n;int ans=0;r=0,l=0; while(n--){ int a,b; cin>>a>>b; if(a==1){ r++; } if(b==1){ l++; }if(a==b){ r--; } } cout<<r*l; }

Compilation message (stderr)

triangle.cpp: In function 'int main()':
triangle.cpp:5:26: error: 'r' was not declared in this scope
    5 |         cin>>n;int ans=0;r=0,l=0;
      |                          ^
triangle.cpp:5:30: error: 'l' was not declared in this scope
    5 |         cin>>n;int ans=0;r=0,l=0;
      |                              ^