結果
| 問題 |
No.851 テストケース
|
| コンテスト | |
| ユーザー |
funakoshi
|
| 提出日時 | 2019-09-03 09:38:21 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,342 bytes |
| コンパイル時間 | 122 ms |
| コンパイル使用メモリ | 31,744 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-23 09:45:09 |
| 合計ジャッジ時間 | 796 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | WA * 20 |
ソースコード
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
int main(void)
{
char str[1000]="";
int num;
scanf("%d\n",&num);
int numlist[3]={0};
int ans[3]={0};
for(int i=0;i<num;i++)
{
fgets(str,num,stdin);
if(str[1]==' ')
{
printf("assert");
return 0;
}
else
{
numlist[i]=str[0]-'0';
}
}
for(int i=0,k=0;i<num-1;i++)
{
for(int j=i+1;j<num;j++,k++)
{
ans[k]=numlist[i]+numlist[j];
}
}
for(int i=0;i<num-1;i++)
{
for(int j=i+1;j<num;j++)
{
if(ans[i]>ans[j])
{
int tmp=ans[i];
ans[i]=ans[j];
ans[j]=tmp;
}
}
}
int show=0;
for(int i=0;i<2;i++)
{
for(int j=i+1;j<3;j++)
{
if(ans[i]!=ans[j])
{
show=ans[1];
}
else if(ans[i]==ans[j])
{
if(i==0)
{
show=ans[1];
}
else
{
show=ans[0];
}
}
}
}
printf("%d",show);
}
funakoshi