Submission #499420

#TimeUsernameProblemLanguageResultExecution timeMemory
499420RandeLjeto (COCI21_ljeto)C++14
0 / 50
0 ms204 KiB
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; long long c1=0; long long c2=0; int tt,aa,bb; int i,ii; int r,rr; cin>>tt>>aa>>bb; if(aa<=4){ c1+=100; i=tt; r=aa; } else if(aa>=5){ c2+=100; ii=tt; rr=aa; } for(int j=1;j<n;j++){ int t,a,b; cin>>t>>a>>b; if(a<=4){ if(abs(i-t)<=10&&a==r){ c1+=150; i=t; } else if(a!=r){ c1+=100; i=t; } r=a; } else if(a>=5){ if(abs(ii-t)<=10&&a==rr){ c2+=150; ii=t; } else if(a!=rr){ c2+=100; ii=t; rr=a; } } } cout<<c1<<" " <<c2<<endl; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:42:17: warning: 'rr' may be used uninitialized in this function [-Wmaybe-uninitialized]
   42 |            else if(a!=rr){
      |                 ^~
Main.cpp:27:26: warning: 'r' may be used uninitialized in this function [-Wmaybe-uninitialized]
   27 |           if(abs(i-t)<=10&&a==r){
      |              ~~~~~~~~~~~~^~~~~~
Main.cpp:38:21: warning: 'ii' may be used uninitialized in this function [-Wmaybe-uninitialized]
   38 |            if(abs(ii-t)<=10&&a==rr){
      |                   ~~^~
Main.cpp:27:19: warning: 'i' may be used uninitialized in this function [-Wmaybe-uninitialized]
   27 |           if(abs(i-t)<=10&&a==r){
      |                  ~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...