結果

問題 No.8043 yukicoderへようこそ!
ユーザー fura
提出日時 2020-04-13 18:37:36
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 742 bytes
コンパイル時間 2,905 ms
コンパイル使用メモリ 197,768 KB
最終ジャッジ日時 2025-01-09 18:09:55
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;
using lint=long long;

int main(){
	vector<string> in;
	while(1){
		string s; getline(cin,s);
		if(s.empty()) break;
		in.emplace_back(s);
	}

	if(in.size()==1){ // 9000, 480, 9002
		if(isdigit(in[0][0])){ // 480
			int n=stoi(in[0]);
			cout<<n*(n+1)/2<<'\n';
		}
		else{ // 9000
			cout<<"Hello World!\n";
		}
	}
	else{ // 9001, 9008, 9009
		if(isalpha(in[1][0])){ // 9001
			stringstream ss(in[0]);
			int a,b; ss>>a>>b;
			cout<<a+b<<' '<<in[1]<<'\n';
		}
		else{ // 9008, 9009
			stringstream ss;
			for(auto s:in) ss<<s<<' ';
			int n; ss>>n;
			lint ans=0;
			rep(i,n){
				lint a; ss>>a;
				ans+=a;
			}
			cout<<ans<<'\n';
		}
	}

	return 0;
}
0