結果
問題 | No.966 引き算をして門松列(その1) |
ユーザー | courange_cou |
提出日時 | 2020-01-13 21:58:25 |
言語 | C (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,649 bytes |
コンパイル時間 | 734 ms |
コンパイル使用メモリ | 29,184 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-02 06:26:00 |
合計ジャッジ時間 | 704 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,812 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
ソースコード
#include <stdio.h> int main(){ int n,a[10000],b[10000],c[10000],ans[10000],x; int A,B,C; scanf("%d\n",&n); for(int i = 0;i < n;i++){ scanf("%d %d %d",&a[i],&b[i],&c[i]); } for(int i = 0;i < n;i++){ if((a[i] == b[i])&&(a[i] == c[i])){ ans[i] = 3; //printf("flag:C\n"); }else if( ((b[i] > a[i])&&(a[i] > c[i]))|| ((b[i] > c[i])&&(c[i] > a[i]))|| ((a[i] > c[i])&&(c[i] > b[i]))|| ((c[i] > a[i])&&(c[i] > a[i]))){ ans[i] = 0; //printf("flag:A\n"); }else if(a[i] + b[i] + c[i] <= 6){ ans[i] = -1; //printf("flag:B\n"); }else { if((a[i] < b[i])&&(b[i] > c[i])){ x = c[i]; c[i] = b[i]; b[i] = x; }else if((b[i] > a[i])&&(a[i] > c[i])){ x = a[i]; a[i] = b[i]; b[i] = x; }else if((b[i] > c[i])&&(c[i] > a[i])){ x = a[i]; a[i] = b[i]; b[i] = x; x = c[i]; c[i] = b[i]; b[i] = x; }else if((c[i] > a[i])&&(a[i] > b[i])){ x = a[i]; a[i] = c[i]; c[i] = x; x = c[i]; c[i] = b[i]; b[i] = x; }else if((c[i] > b[i])&&(b[i] > a[i])){ x = a[i]; a[i] = c[i]; c[i] = x; } a[i] = A; b[i] = B; c[i] = C; ans[i] = A-C; if(A-C == C)ans[i]++; if(ans[i] > A-B)ans[i] == A-B; if(A-B == B)ans[i]++; //printf("flag:D\n"); } printf("%d\n",ans[i]); } }