# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1110629 | 2024-11-10T06:25:53 Z | vjudge1 | Tuna (COCI17_tuna) | C++17 | 1 ms | 508 KB |
#include <bits/stdc++.h> using namespace std; int main() { int n,i; cin>>n>>i; int dan; int topl=0; int h[n], z[n]; for(int j; j<n; j++){ cin>>h[j]>>z[j]; if(h[j]>z[j]){ if(h[j]-z[j]<=i) topl+=h[j]; else{ cin>>dan; topl+=dan; } } else{ if(z[j]-h[j]<=i) topl+=z[j]; else{ cin>>dan; topl+=dan; } } } cout<<topl; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 336 KB | Output is correct |
2 | Correct | 1 ms | 336 KB | Output is correct |
3 | Correct | 1 ms | 336 KB | Output is correct |
4 | Correct | 1 ms | 336 KB | Output is correct |
5 | Correct | 1 ms | 336 KB | Output is correct |
6 | Correct | 1 ms | 336 KB | Output is correct |
7 | Correct | 1 ms | 336 KB | Output is correct |
8 | Correct | 1 ms | 508 KB | Output is correct |
9 | Correct | 1 ms | 336 KB | Output is correct |
10 | Correct | 1 ms | 336 KB | Output is correct |