結果
| 問題 |
No.1423 Triangle of Multiples
|
| コンテスト | |
| ユーザー |
tsuishi
|
| 提出日時 | 2021-03-19 11:05:30 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,192 bytes |
| コンパイル時間 | 217 ms |
| コンパイル使用メモリ | 30,208 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-17 21:24:04 |
| 合計ジャッジ時間 | 873 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 4 |
ソースコード
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Yukicoder №1423 Triangle of Multiples ★☆
// https://yukicoder.me/problems/no/1423
// ***********************
#define gc(c) do{c = getchar();}while(0)
#define GETLINE(str) do{char *p;fgets(str,sizeof(str),stdin);p=strchr(str,'\n');if(p)*p='\0';}while(0)
static char *GETWORD(char* str) {char c;char *cp;cp=&str[0];gc(c);while(c!=EOF){if((c==' ')||(c=='\n'))break;*cp++=c;gc(c);}*cp='\0';return &str[0];}
static int GETLINEINT(void) {char s[34];GETLINE(s);return atoi(s);}
static int GETWORDINT(void) {char s[34];GETWORD(s);return atoi(s);}
static int maxi(int a,int b){if(a>b){return a;}return b;}
#define Yes(a) printf("%s",((a)?"Yes":"No"))
// *********************
static int min(int a,int b){if(a<b){return a;}return b;}
#define REP(a,b) for(int a=0;a<(b);++a)
// *********************
int main( void ) {
int a,b,c;
int q;
q = GETLINEINT();
REP(i,q) {
a = GETWORDINT();
b = GETWORDINT();
c = GETWORDINT();
if( a < b && a < c ) {
printf("%d %d %d\n",a*maxi(b,c),b,c);
} else if( b < a && b < c ) {
printf("%d %d %d\n",a,b*maxi(a,c),c);
} else {
printf("%d %d %d\n",a,b,c*maxi(a,b));
}
}
}
tsuishi