Submission #599437

#TimeUsernameProblemLanguageResultExecution timeMemory
599437DrollWolfTuna (COCI17_tuna)C++17
50 / 50
1 ms300 KiB
#include <bits/stdc++.h> using namespace std; typedef long long int lli; //const int N = 2*(10e5+7); //int arr[N]; int main() { lli t, n, c, a, b, ans, i, x; char ch; ans=0; cin>>n>>x; string str; while(n--) { cin>>a>>b; if(abs(a-b)<=x) ans+=max(a, b); else { cin>>c; ans+=c; } } cout<<ans<<'\n'; //freopen("diamond.in","r",stdin); //freopen("diamond.out","w",stdout); }

Compilation message (stderr)

tuna.cpp: In function 'int main()':
tuna.cpp:11:6: warning: unused variable 't' [-Wunused-variable]
   11 |  lli t, n, c, a, b, ans, i, x;
      |      ^
tuna.cpp:11:26: warning: unused variable 'i' [-Wunused-variable]
   11 |  lli t, n, c, a, b, ans, i, x;
      |                          ^
tuna.cpp:12:7: warning: unused variable 'ch' [-Wunused-variable]
   12 |  char ch;
      |       ^~
#Verdict Execution timeMemoryGrader output
Fetching results...