Submission #6580839


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
template<class S, class T> inline S min_L(S a,T b){
  return a<=b?a:b;
}
inline void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(long long x){
  char f[20];
  int m=0, s=0;
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
int N;
int A;
int B;
int main(){
  int Lj4PdHRW;
  long long res=0;
  rd(N);
  for(Lj4PdHRW=0;Lj4PdHRW<N;Lj4PdHRW++){
    rd(A);
    rd(B);
    res +=min_L(A/2, B);
  }
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20190721-1

// --- original code ---
// int N, A, B;
// {
//   ll res = 0;
//   rd(N);
//   rep(N){
//     rd(A,B);
//     res += min(A/2,B);
//   }
//   wt(res);
// }

Submission Info

Submission Time
Task E - カツサンドくん α
User LayCurse
Language C++14 (GCC 5.4.1)
Score 200
Code Size 1224 Byte
Status AC
Exec Time 9 ms
Memory 256 KiB

Judge Result

Set Name sample all
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 8
Set Name Test Cases
sample sample-01.txt, sample-02.txt
all sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, sample-01.txt, sample-02.txt
Case Name Status Exec Time Memory
01-01.txt AC 1 ms 256 KiB
01-02.txt AC 1 ms 256 KiB
01-03.txt AC 2 ms 256 KiB
01-04.txt AC 9 ms 256 KiB
sample-01.txt AC 1 ms 256 KiB
sample-02.txt AC 1 ms 256 KiB