結果

問題 No.280 歯車の問題(1)
コンテスト
ユーザー Mayimg
提出日時 2019-01-09 22:32:01
言語 C++14
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 1,000 ms
+ 387µs
コード長 311 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 828 ms
コンパイル使用メモリ 181,780 KB
実行使用メモリ 9,876 KB
最終ジャッジ日時 2026-09-28 22:11:03
合計ジャッジ時間 3,629 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:18:15: warning: 'top' may be used uninitialized [-Wmaybe-uninitialized]
   18 |         printf("%lld/%lld\n", top, bottom);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:11:19: note: 'top' was declared here
   11 |         long long top, bottom;
      |                   ^~~
main.cpp:18:15: warning: 'bottom' may be used uninitialized [-Wmaybe-uninitialized]
   18 |         printf("%lld/%lld\n", top, bottom);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:11:24: note: 'bottom' was declared here
   11 |         long long top, bottom;
      |                        ^~~~~~

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;


int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);  
	
	int n;
	cin >> n;
	long long top, bottom;
	for(int i = 0; i < n; i++) {
		long long z;
		cin >> z;
		if(i == 0) bottom = z;
		if(i == n - 1) top = z;
	}
	printf("%lld/%lld\n", top, bottom);
	return 0;
}
0