結果

問題 No.201 yukicoderじゃんけん
ユーザー 158b
提出日時 2015-05-03 23:46:51
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 745 bytes
コンパイル時間 440 ms
コンパイル使用メモリ 54,996 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-05 17:34:10
合計ジャッジ時間 1,108 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include <string>
using namespace std;

int count(char a[]){
	int i=0;
	while(a[i] != '\0'){
		i++;
	}
	
	return i;
}

int main(){

	char name[2][102];
	char point[2][10002] = {0};
	char te[2][10];

	
	for(int i=0; i<2; i++){
		cin >> name[i];
		cin >> point[i];
		cin >> te[i];
	}
	
	if(count(point[0]) > count(point[1])){
		cout << name[0] << endl;
		return 0;
	}else if(count(point[0]) < count(point[1])){
		cout << name[1] << endl;
		return 0;
	}else{
		
		int i = 0;
		while(point[0][i] == point[1][i] && i < 10002){
			i++;
		}
		
		if(point[0][i] > point[1][i]){
			cout << name[0] << endl;
		}else if(point[0][i] < point[1][i]){
			cout << name[1] << endl;
		}else{
			cout << -1 << endl;
		}
		
	}
	

	
	return 0;
}

0