結果

問題 No.851 テストケース
ユーザー LayCurseLayCurse
提出日時 2019-08-21 05:25:46
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 3,153 ms
コード長 1,597 bytes
コンパイル時間 2,832 ms
コンパイル使用メモリ 207,528 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 16:50:05
合計ジャッジ時間 3,652 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline int rdLine_L(char c[]){
  int i, sz=0;
  for(;;){
    i = getchar_unlocked();
    if(i=='\r'){
      continue;
    }
    if(i=='\n'){
      break;
    }
    if(i==EOF){
      if(sz==0){
        c[sz] = '\0';
        return -1;
      }
      break;
    }
    c[sz++] = i;
  }
  c[sz]='\0';
  return sz;
}
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');
  }
}
inline void wt_L(const char c[]){
  int i=0;
  for(i=0;c[i]!='\0';i++){
    putchar_unlocked(c[i]);
  }
}
long long A[3];
char buf[4][1000];
int len[4];
int main(){
  int i, j;
  for(i=0;i<(4);i++){
    len[i] =rdLine_L(buf[i]);
  }
  if(len[3]==-1){
    wt_L("\"assert\"");
    wt_L('\n');
    return 0;
  }
  for(i=0;i<(3);i++){
    sscanf(buf[i+1], "%lld", A+i);
  }
  sort(A,A+3);
  if(A[0]==A[1] || A[1]==A[2]){
    wt_L(A[0]+A[1]);
    wt_L('\n');
  }
  else{
    wt_L(A[0]+A[2]);
    wt_L('\n');
  }
  return 0;
}
// cLay varsion 20190820-1

// --- original code ---
// ll A[3];
// char buf[4][1000]; int len[4];
// {
//   int i, j;
//   
//   rep(i,4) len[i] = rdLine(buf[i]);
//   if(len[3]==-1){
//     wt("\"assert\"");
//     return 0;
//   }
// 
//   rep(i,3) sscanf(buf[i+1], "%lld", A+i);
// 
//   sort(A,A+3);
//   if(A[0]==A[1] || A[1]==A[2]) wt(A[0]+A[1]); else wt(A[0]+A[2]);
// }
0