제출 #1323672

#제출 시각아이디문제언어결과실행 시간메모리
1323672marzuq01Bouquet (EGOI24_bouquet)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
#define lint long long
#define pb push_back
#define vi vector<int>
#define vll vector<long long>
#define nl '\n'
#define debun(x) cout << #x << ": " << x << "\n";
#define debug(x) cout << #x << ": " << x << " ";

const int mod = 1e9+7;
const int MOD = 998244353;

string yes = "YES";
string no = "NO";

// CODING SETTING :O

void freo(string name) {
	freopen((name+".in").c_str(),"r",stdin);
	freopen((name+".out").c_str(),"w",stdout);
}
void fastIO() {
	ios::sync_with_stdio(0);
	cin.tie(0);
}
// WRONG ANSWER ON TEST 2: ?_?

void inputer() {
	// take the input ONLY:

}

void outputer() {
	//take the input
	//output inputs...
	//solve();


}

void tracker(int test_case, int wanted) {
	if (wanted != test_case) inputer();
	else outputer();
}

// GENERAL SHORTCUTS AND FUNCTIONS :D
template<typename T>
void vprint(const vector<T> &arr) {
	for (auto i : arr) cout << i << " ";
	cout << nl;
}
template<typename T, typename ABCDEF>
void aprint(T arr[],ABCDEF n) {
	for (ABCDEF i = 0; i < n;i++) { cout << arr[i] << " "; }
	cout << "\n";
}
template<typename T>
T expo(T a, T b) {
	if (b == 0) return 1;
	else if (b == 1) return a;
	if (b % 2 == 0) return expo(a*a % mod,b/2) % mod;
	else return (a*expo(a*a % mod, b/2) % mod) % mod;
}

template<typename T>
T gcd(T a, T b) {
	if (a == 0) return b;
	else return gcd(b%a,a);
}
// ============< DONT TOUCH CODES ABOVE >=============
int isprime[2000000];
vector<int> prime;
void thanos() {
    for (int i = 0;i < 2000000;i++) isprime[i] = 1;
    isprime[0] = isprime[1] = 0;
    for (int j = 4; j < 2000000;j+=2) isprime[j] = 0;
    for (int i = 3;i*i < 2000000;i+=2) {
        for (int j = i*i; j < 2000000;j += i) isprime[j] = 0;
    }
    prime.pb(2);
    for (int i = 3;i < 2000000;i+=2) if(isprime[i]) prime.pb(i);
}

// ============< DONT also TOUCH CODES ABOVE >=============

void init() {
    //thanos();
}


void solve() {
    int n; cin >> n;
    vector<pair<int,int>> arr(n);
    for (int i = 0; i < n;i++) cin >> arr[i].first >> arr[i].second;
    int pack = arr[i].first + 1;
    cout << (n + pack - 1)/pack << nl;
}


int main()
{
	//freo("haybales");

	fastIO();

    long long int t=1;
    //cin >> t;

	init();
    for (int aura = 0; aura < t; aura++) {
        //cout << "-------\n";
        //cout << "Case #" <<aura+1 << ":";
		solve();
    }


    //wrong answer finder: XD
    /*
    if (t != 100) {
		while(t--) solve();
    } else {
		for (int aura = 1; aura <= t;aura++) {
			tracker(aura,68);
		}
    }
    */
    return 0;
}

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

Main.cpp: In function 'void solve()':
Main.cpp:96:20: error: 'i' was not declared in this scope
   96 |     int pack = arr[i].first + 1;
      |                    ^
Main.cpp: In function 'void freo(std::string)':
Main.cpp:20:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   20 |         freopen((name+".in").c_str(),"r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:21:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |         freopen((name+".out").c_str(),"w",stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~