제출 #45864

#제출 시각아이디문제언어결과실행 시간메모리
45864TheDarkningPalembang Bridges (APIO15_bridge)C++17
0 / 100
2 ms820 KiB
/** ▄█▀ ▀█▀ ▄▀▄ █▀ █▄█▄█ ▄▀▄ █▀ ▄█▀ <⇋⇋⇋⋛∰≓⊂(⌒,_ゝ⌒)⊃≓∰⋛⇋⇋⇋> ♔♕♖♗♘♙ ☜❷☞✪ ィℋ६ ≈ ᗫẵℜℵĬŊĞ ✪☜❷☞ ♚♛♜♝♞♟ ♔♕♖♗♘♙ ♚♛♜♝♞♟ ˙·٠•●♥ Ƹ̵̡Ӝ̵̨̄Ʒ ♥●•٠·˙ 1 5 B 0 A 4 B 1 B 3 A 5 B 7 B 2 A 6 B 1 A 7 **/ #include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <iomanip> #include <time.h> #include <map> #include <deque> #include <string> #include <set> #define sz(s) s.size() #define pb push_back #define fr first #define sc second #define mk make_pair #define int long long #define all(s) s.begin(), s.end() using namespace std; const int N = 1e6 + 5; const int inf = 1e9 + 7; int n, k, q, pos1, pos2, cnt, sumx, sumn; char t1, t2; inline void get() { t1 = getchar(); while( t1 == '\n' or t1 == ' ' ) t1 = getchar(); cin >> pos1; t2 = getchar(); while( t2 == '\n' or t2 == ' ' ) t2 = getchar(); cin >> pos2; } main() { cin >> k >> q; n = q; while( n-- ) { get(); if( t1 == t2 ) continue; cnt++; sumx += max( pos1, pos2 ); sumn += min( pos1, pos2 ); } cout << ( ( sumx + sumn ) / cnt / 2 ); }

컴파일 시 표준 에러 (stderr) 메시지

bridge.cpp:57:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main()
      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...