☰ Categories

code generation for online assessments

SOLVE THE QUESTION IN CPP, USING NAMESPACE STD, IN A SIMPLE BUT HIGHLY EFFICIENT WAY, AND PROVIDE IT WITH THIS RESTYLING: no comments, no space betwee

CategoryDevelopment › Coding
TagsDraftingDeveloperCode
Prompt
SOLVE THE QUESTION IN CPP, USING NAMESPACE STD, IN A SIMPLE BUT HIGHLY EFFICIENT WAY, AND PROVIDE IT WITH THIS RESTYLING:
no comments, no space between operator and operand but proper margin and indentation, brackets open on the next line always and do not forget to rename variables as short as possible, possibly alphabets

What this prompt does

This prompt generates online-assessment solutions in a specific C++ style. It fixes the language to C++ and strongly constrains formatting rather than emphasizing explanation.

Model comparison

ChatGPT is strongest in accuracy and concision. Gemini implements the solution well but misstates complexity, while [C] is missing.

ChatGPTTop overall
45/ 50

+ Concise, with correct complexity and duplicate handling

- Spaces in reference declarations violate the requested style

Gemini
40/ 50

+ Closely follows the format and catches the faulty example

- Misstates complexity as O(N+K) and invents a runtime estimate

CriterionChatGPTGeminiLeader
Instruction following89Gemini +13%
Accuracy97ChatGPT +29%
Specificity99Tie
Structure98ChatGPT +13%
Right length107ChatGPT +43%

Scored 1–10 by gpt-5.6-sol with model names hidden (2026-09-24). This is an AI review, not a measurement.

Read full answers

We gave three models the same input and copied their answers unedited. Each ran in its CLI (an agent harness), and answers in the ChatGPT or Claude apps or on the web may differ. Outputs are in Korean.

Input used
[Pasted material]
문제: 정수 배열 nums(길이 최대 100,000)와 정수 target이 주어진다. nums에서 두 원소의 합이 target이 되는 인덱스 쌍 (i, j)를 i < j 조건으로 모두 찾아, i 기준 오름차순으로 정렬된 2차원 벡터로 반환하라. 시간 제한 2초, 메모리 제한 256MB. 예시: nums = [2,7,11,15,3,6,9], target = 9 이면 결과는 [[0,1],[2,5]] 이다. 같은 값이 여러 번 나올 수 있으며, 하나의 인덱스는 여러 쌍에 중복 사용될 수 있다.
gpt-5.6-luna (codex CLI · 에이전트 하네스) · Run on 2026-09-24
#include <bits/stdc++.h>
using namespace std;

vector<vector<int>> f(vector<int>& a,int t)
{
    unordered_map<int,vector<int>> m;
    vector<vector<int>> r;

    for(int i=0;i<a.size();i++)
    {
        m[a[i]].push_back(i);
    }

    for(int i=0;i<a.size();i++)
    {
        auto it=m.find(t-a[i]);

        if(it==m.end())
        {
            continue;
        }

        auto& v=it->second;
        auto p=lower_bound(v.begin(),v.end(),i+1);

        for(;p!=v.end();p++)
        {
            r.push_back({i,*p});
        }
    }

    return r;
}

각 인덱스 i를 기준으로 i보다 큰 보완값의 인덱스를 찾아 결과에 추가합니다. 인덱스를 앞에서부터 처리하므로 결과는 i 기준 오름차순이며, 시간 복잡도는 O(n log n+k), 공간 복잡도는 O(n+k)입니다. 여기서 k는 결과 쌍의 개수입니다.

예시의 올바른 결과는 [[0,1],[4,5]]입니다.

More in this category

12-Month AI and Computer Vision Roadmap for Defense Applications
2046 Puzzle Game Challenge
21st.dev component prompt
3D FACTORY
3D FPS Game