criyle/codenet-compile-errors huggingface dataset:
Language: C++

vector<long long> ret;

void divisor(long long n) {
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(ret.begin(), ret.end()); // 昇順に並べる
    return;
}

int main(){
  ll ans=0;
  ll n; cin>>n;
  divisor(n);
  for(auto x : ret){
    if(x>=(n/x-1)){
      continue;
    }else{
      ans+=n/x-1;
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc:1:1: error: 'vector' does not name a type
    1 | vector<long long> ret;
      | ^~~~~~
a.cc: In function 'void divisor(long long int)':
a.cc:6:13: error: 'ret' was not declared in this scope
    6 |             ret.push_back(i);
      |             ^~~
a.cc:10:10: error: 'ret' was not declared in this scope
   10 |     sort(ret.begin(), ret.end()); // 昇順に並べる
      |          ^~~
a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |     sort(ret.begin(), ret.end()); // 昇順に並べる
      |     ^~~~
      |     short
a.cc: In function 'int main()':
a.cc:15:3: error: 'll' was not declared in this scope
   15 |   ll ans=0;
      |   ^~
a.cc:16:5: error: expected ';' before 'n'
   16 |   ll n; cin>>n;
      |     ^~
      |     ;
a.cc:16:9: error: 'cin' was not declared in this scope
   16 |   ll n; cin>>n;
      |         ^~~
a.cc:16:14: error: 'n' was not declared in this scope
   16 |   ll n; cin>>n;
      |              ^
a.cc:18:16: error: 'ret' was not declared in this scope
   18 |   for(auto x : ret){
      |                ^~~
a.cc:22:7: error: 'ans' was not declared in this scope
   22 |       ans+=n/x-1;
      |       ^~~
a.cc:25:3: error: 'cout' was not declared in this scope
   25 |   cout<<ans<<endl;
      |   ^~~~
a.cc:25:9: error: 'ans' was not declared in this scope
   25 |   cout<<ans<<endl;
      |         ^~~
a.cc:25:14: error: 'endl' was not declared in this scope
   25 |   cout<<ans<<endl;
      |              ^~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;

vector<long long> divisor(long long n) {
    vector<long long> ret;
    for(long long i = 1; i * i <= n; i++) {
      if(n % i == 0) {
        ret.push_back(i);
        if(i * i != n) ret.push_back(n / i);
      }
    }
    sort(begin(ret), end(ret));
    return (ret);
  }

int main() {
  long long N;
  cin >> N;
  vecotr<long long> di = divisor(N);
  long long ret = 0;
  for (long long i=0; i<di.size();i++) {
    if (N / (di[i]-1) == N % (di[i]-1)) ret += (di[i]-1);
  }
  cout << ret << endl;
}

Compiler output:
a.cc: In function 'std::vector<long long int> divisor(long long int)':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |     sort(begin(ret), end(ret));
      |     ^~~~
      |     short
a.cc: In function 'int main()':
a.cc:20:3: error: 'vecotr' was not declared in this scope
   20 |   vecotr<long long> di = divisor(N);
      |   ^~~~~~
a.cc:20:10: error: expected primary-expression before 'long'
   20 |   vecotr<long long> di = divisor(N);
      |          ^~~~
a.cc:22:25: error: 'di' was not declared in this scope; did you mean 'i'?
   22 |   for (long long i=0; i<di.size();i++) {
      |                         ^~
      |                         i
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
int MOD = 1000000007;
vector< int64_t > divisor(int64_t n) {
  vector< int64_t > ret;
  for(int64_t i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

int main() {
  int64_t N;
  cin >> N;
  int64_t ans = 0;
  vector<int64_t> yakusuu = divisor(N);
  sort(yakusuu.begin(),yakusuu.end());
  for(int64_t i:yaksuu){
    if(i=1){
      continue;
    }
    else if(N % (i-1) == 0){
      continue;
    }
    else{
      ans += i -1;
    }
  }
  cout << ans << endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'yaksuu' was not declared in this scope; did you mean 'yakusuu'?
   24 |   for(int64_t i:yaksuu){
      |                 ^~~~~~
      |                 yakusuu
Language: C++

int main() {
  long long int N; cin >> N;
  long long int ac=N-1;
  for(long long int i=2; i*i<N; i++){
    if(N%i==0 && N%(N/i-1)!=0)  ac+=N/i-1;
  }
  cout << ac;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:20: error: 'cin' was not declared in this scope
    2 |   long long int N; cin >> N;
      |                    ^~~
a.cc:7:3: error: 'cout' was not declared in this scope
    7 |   cout << ac;
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll ZERO = 0;
const ll INF = 1e14;
const ll MOD = 1000000007;
const double PI = 3.1415926535897;

int main() {
    ll N;
    cin >> N;
    ll ret = 0;
    for(ll i = 1;i * i < N;i++) {
        if(floot((N - i) / i) == (N - i) / i && (N - i) / i > i) {
            ret += (N - i) / i;
        }
    }
    cout << ret << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 'floot' was not declared in this scope; did you mean 'floor'?
   15 |         if(floot((N - i) / i) == (N - i) / i && (N - i) / i > i) {
      |            ^~~~~
      |            floor
Language: C

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i < (int)(n);i++)
using namespace std;

int main(){
  int64_t n;
  cin >> n;
  //n=mk+k n=(m+1)k i = k+1
  queue<int64_t> que;
  for(int i=1;i<=sqrt(n);i++){
    if(n%i==0){
      if(i*i!=n){
        que.push(i);
        que.push(n/i);
      }else{
        que.push(i);
      }
    }
  }
  int64_t sum = 0;
  while(!que.empty()){
    int64_t a = que.front();
    que.pop();
    if((n/a)-1>a){
      sum += (n/a)-1;
      //cout << n/a-1 << ",";
    }
  }
        
        
  cout << sum << endl;
  
        
        
      
}


Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
using namespace std;

vector<long long> calc_divisor(long long n) {
    vector<long long> res;
    for (long long i = 1LL; i*i <= n; ++i) {
        if (n % i == 0) {
            res.push_back(i);
            long long j = n / i;
            if (j != i) res.push_back(j);
        }
    }
    sort(res.begin(), res.end());
    return res;
}

long long solve(long long N) {
    auto div = calc_divisor(N);
    long long res = 0;
    for (auto r : div) {
        if (r > 1000000) continue;
        if (N > r*r + r) res += (N-r)/r;
    }
    return res;
}

int main() {
    long long N; cin >> N;
    cout << solve(N) << endl;
}

Compiler output:
a.cc: In function 'std::vector<long long int> calc_divisor(long long int)':
a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |     sort(res.begin(), res.end());
      |     ^~~~
      |     short
Language: C++

#include <iostream>
#include<vector>
#include<algorithm>
#include <queue>
#include <string>
#include <set>
#include <bitset>

using namespace std;
#define ff(i,n,m) for(int i=n;i<m;i++)
#define i64 int64_t
#define tos(x) to_string(x)

int main() {
	i64 n;
	cin >> n;
	set<int> m;
	i64 ans = 0;
	ff(i, 1, sqrt(n)) {
		if (n % i == 0) {
			ans += (n / i) - 1;
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: 'sqrt' was not declared in this scope
   19 |         ff(i, 1, sqrt(n)) {
      |                  ^~~~
a.cc:10:33: note: in definition of macro 'ff'
   10 | #define ff(i,n,m) for(int i=n;i<m;i++)
      |                                 ^
Language: C++

int main(){
    long long N,ans=0;
    cin >> N;
    for(long long int i = 1;i <= int(sqrt(N)); ++i){
        if(N%i==0) ans += N/i - 1;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> N;
      |     ^~~
a.cc:4:38: error: 'sqrt' was not declared in this scope
    4 |     for(long long int i = 1;i <= int(sqrt(N)); ++i){
      |                                      ^~~~
a.cc:7:5: error: 'cout' was not declared in this scope
    7 |     cout << ans << endl;
      |     ^~~~
a.cc:7:20: error: 'endl' was not declared in this scope
    7 |     cout << ans << endl;
      |                    ^~~~
Language: C++

import java.util.*;

public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        long N = sc.nextLong();
        sc.close();

        long sum = 0;

        long limit = N;
        long i = 1;
        while(i <= limit){
            long m = (N-i)/i;
            if(m > i && (N-i)%i == 0)
                sum += m;
            i++;
            limit = m;
        }
        System.out.println(sum);
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main{
      | ^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <queue>
#include <cmath>

using namespace std;

void Diverta2019_D()
{
	long long int N;
	cin >> N;
	long long int M = static_cast<long long int>(sqrt(static_cast<double>(N))) + 1;

	long long int sum = 0;
	for (size_t i =1; i < M; ++i)
	{
		if (N % i == 0)
		{
			long long int x = N / i - 1;
			if(x > i)
				sum += x;
		}
	}
	cout << sum << endl;
}

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <queue>
#include <cmath>

using namespace std;

void Diverta2019_D()
{
	long long int N;
	cin >> N;
	long long int M = static_cast<long long int>(sqrt(static_cast<double>(N))) + 1;

	long long int sum = 0;
	for (size_t i =1; i < M; ++i)
	{
		if (N % i == 0)
		{
			long long int x = N / i - 1;
			if(x > i)
				sum += x;
		}
	}
	cout << sum << endl;
}

int main()
{
	Diverta2019_D();
	return 0;
}

Compiler output:
a.cc:48:6: error: redefinition of 'void Diverta2019_D()'
   48 | void Diverta2019_D()
      |      ^~~~~~~~~~~~~
a.cc:15:6: note: 'void Diverta2019_D()' previously defined here
   15 | void Diverta2019_D()
      |      ^~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <queue>
#include <cmath>

using namespace std;

void Diverta2019_D()
{
	long long int N;
	cin >> N;
	long long int M = static_cast<long long int>(sqrt(static_cast<double>(N))) + 1;

	long long int sum = 0;
	for (size_t i =1; i < M; ++i)
	{
		if (N % i == 0)
		{
			long long int x = N / i - 1;
			if(x > i)
				sum += x;
		}
	}
	cout << sum << endl;
}

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <queue>
#include <cmath>

using namespace std;

void Diverta2019_D()
{
	long long int N;
	cin >> N;
	long long int M = static_cast<long long int>(sqrt(static_cast<double>(N))) + 1;

	long long int sum = 0;
	for (size_t i =1; i < M; ++i)
	{
		if (N % i == 0)
		{
			long long int x = N / i - 1;
			if(x > i)
				sum += x;
		}
	}
	cout << sum << endl;
}

Compiler output:
a.cc:48:6: error: redefinition of 'void Diverta2019_D()'
   48 | void Diverta2019_D()
      |      ^~~~~~~~~~~~~
a.cc:15:6: note: 'void Diverta2019_D()' previously defined here
   15 | void Diverta2019_D()
      |      ^~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <queue>

using namespace std;

void Diverta2019_D()
{
	long long N;
	cin >> N;
	long long M = static_cast<long long>(sqrt(static_cast<double>(N))) + 1;

	long long sum = 0;
	for (size_t i =1; i < M; ++i)
	{
		if (N % i == 0)
		{
			long long x = N / i - 1;
			if(x > i)
				sum += x;
		}
	}
	cout << sum << endl;
}
int main()
{
	Diverta2019_D();
	return 0;
}


Compiler output:
a.cc: In function 'void Diverta2019_D()':
a.cc:18:46: error: 'sqrt' was not declared in this scope
   18 |         long long M = static_cast<long long>(sqrt(static_cast<double>(N))) + 1;
      |                                              ^~~~
Language: C

#include<stdio.h>
int main(){
    long long int n,sum=0,d=0;
 　 int i;
    scanf("%lld", &n);
    for(i = 1; i<1000000; i++){
        if(i==d) break;        
        if(n%i == 0){
            d = n/i;
            if(d==1) break;
            if(n/(d-1) == n%(d-1))            
            sum += d-1;
        }
    }
    
    printf("%lld",sum);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:4:2: error: stray '\343' in program
    4 |  <U+3000> int i;
      |  ^~~~~~~~
Language: C

#include<stdio.h>
#include<limits.h>
int main(void){
  int N;
  scanf("%d",&N);
  int i;
  long int sum=0
  for(i=1;i<N;i++){
    if(N/i==N%i)sum+=i;
  }
  printf("%d",sum);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:3: error: expected ',' or ';' before 'for'
    8 |   for(i=1;i<N;i++){
      |   ^~~
main.c:8:18: error: expected ';' before ')' token
    8 |   for(i=1;i<N;i++){
      |                  ^
      |                  ;
main.c:8:18: error: expected statement before ')' token
Language: C++

#include <bits/stdc++.h>
using namespace std;
__int64 res=0,n;
int main()
{
    cin>>n;
    int x=ceil(sqrt(n));
    for (int i=1;i<x;++i)
        if (n%i==0) res=res+n/i-1;
    cout<<res;
    return 0;
}


Compiler output:
a.cc:3:1: error: '__int64' does not name a type; did you mean '__int64_t'?
    3 | __int64 res=0,n;
      | ^~~~~~~
      | __int64_t
a.cc: In function 'int main()':
a.cc:6:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |     cin>>n;
      |          ^
      |          yn
a.cc:9:21: error: 'res' was not declared in this scope
    9 |         if (n%i==0) res=res+n/i-1;
      |                     ^~~
a.cc:10:11: error: 'res' was not declared in this scope
   10 |     cout<<res;
      |           ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
    preprocess();
    
    long long n;
    cin >> n;
    
    long long ans = 0;
    
    for (long long i = 1; i * i <= n; ++i) if (n % i == 0) {
        ans += i - 1;
        if (i * i != n) {
            ans += n / i - 1;
        }
    }
    
    cout << ans << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'preprocess' was not declared in this scope
    6 |     preprocess();
      |     ^~~~~~~~~~
Language: C++

#include <climits>
#include <algorithm>
#include <stdio.h>
#include <vector>
#include <queue>
using namespace std;

long long sqrt(int N){
    for(long long i = 0; i < N; i++){
        if(i * i > N){
            return i - 1;
        }
    }
    return -1;
}
int main(){
    long long N;
    cin >> N;

    long long sqrt_N = sqrt(N);
    long long ans = 0;
    for(long long i = sqrt_N + 1; i >= 1; i--){
        if(N % i == 0 && N / i > 1){
            long long m = N / i - 1;
            if(N / m  == N % m){
                ans += m;
            } 
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'cin' was not declared in this scope
   18 |     cin >> N;
      |     ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include <queue>
  +++ |+#include <iostream>
    6 | using namespace std;
a.cc:30:5: error: 'cout' was not declared in this scope
   30 |     cout << ans << endl;
      |     ^~~~
a.cc:30:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:30:20: error: 'endl' was not declared in this scope
   30 |     cout << ans << endl;
      |                    ^~~~
a.cc:6:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    5 | #include <queue>
  +++ |+#include <ostream>
    6 | using namespace std;
Language: C++

#include <iostream>
using namespace std;

int main() {
	long long n;
	cin >> n;
	long long ans=0;
	for(int i=1;i<sqrt(n);i++){
		if(n%i==0){
			ans+=((n/i) - 1);
		}
	}
	cout << ans;
	// your code goes here
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: 'sqrt' was not declared in this scope
    8 |         for(int i=1;i<sqrt(n);i++){
      |                       ^~~~
Language: C

#include <stdio.h>
int main()
{
  long long N,a,b,i,sum=0;
  
  scanf("%lld",&N);
  for(i=1;i<=N;i++){
   m=n/i-1;
    if(m>i) sum+=i;
  }
  
  printf("%lld\n",sum);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:4: error: 'm' undeclared (first use in this function)
    8 |    m=n/i-1;
      |    ^
main.c:8:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:6: error: 'n' undeclared (first use in this function)
    8 |    m=n/i-1;
      |      ^
Language: C

#include<stdio.h>
int main()
{
  long long n,an,num;
  
  scanf("%lld", &n);
  
 for(long long i=1;i*i<=n;i++){
    if(n%i==0){
      num=n/i-1;
      if(num>i)
        an+=num;
    }
  }

  printf("%lld", an);
  return 0;

Compiler output:
main.c: In function 'main':
main.c:17:3: error: expected declaration or statement at end of input
   17 |   return 0;
      |   ^~~~~~
Language: C

#include <stdio.h>
int main(){
  long int n;
  scanf("%ld",&n);
  long int sum=0;
  for(long int i=1;i<=n;i++){
    if((n-i)%i==0)     
    	sum+=n/i
  }
  printf("%ld\n",sum);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:17: error: expected ';' before '}' token
    8 |         sum+=n/i
      |                 ^
      |                 ;
    9 |   }
      |   ~
Language: C

#include <stdio.h>
int main(){
  long int n;
  scanf("%ld",&n);
  long int sum=0;
  for(long int i=1;i<=n;i++){
    if(n-i%i==0)     
    	sum+=n/i
  }
  printf("%ld\n",sum);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:17: error: expected ';' before '}' token
    8 |         sum+=n/i
      |                 ^
      |                 ;
    9 |   }
      |   ~
Language: C

include<stdio.h>
int main(){
  long int n;
  scanf("%ld",&n);
  long int sum=0;
  for(long int i=1;i<=n;i++){
    if((i*i-(i-1))%i==0)     
    	sum+=(i*i-(i-1));
  }
  printf("%ld\n",sum);
  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

#include<stdio.h>
int main(){
  long int n;
  scanf("%ld",&n);
  long int sum=0;
  for(long int i=1;i<=n;i++){
    if(i*i-i%==0)     
    	sum+=n/i;
  }
  printf("%ld\n",sum);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:15: error: expected expression before '=' token
    7 |     if(i*i-i%==0)
      |               ^
Language: C

#include<stdio.h>
int main(){
  int n,count=0;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    if(n/i==n%i)
      count++;
  }
  printf("%d",count);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:7: error: 'i' undeclared (first use in this function)
    5 |   for(i=1;i<=n;i++){
      |       ^
main.c:5:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>


int main(void){
    long long N;
    scanf("%lld", &N);
    long long x, sum;
    x = 1;
    sum = 0;
    while(x * x <= N){
        if(N % x == 0){
            sum += n / x - 1;
        }
        x++;
    }
    printf("%lld\n", sum);

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:20: error: 'n' undeclared (first use in this function)
   12 |             sum += n / x - 1;
      |                    ^
main.c:12:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long n,p,ans = 0;
  cin >> n;
  p = sqrt(n);
  for(long long i = 1 ; i <= p ; ++i) 
    if(n % i == 0) {
      if(i !+ 1 && n/(i-1)*i == n) ans += i-1;
      if(i*i != n) {
        long long k = n/i;
        if(n/(k-1)*k == n) ans += k-1;
      }
    }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: expected ')' before '!' token
   10 |       if(i !+ 1 && n/(i-1)*i == n) ans += i-1;
      |         ~ ^~
      |           )
Language: C++

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

long long int n;
int main(){
  cin >> n;
  
  long long sum = 0;
  for(long long i=1;i*i<=n;i++){
    if (n % i == 0){
      ll div = n / i - 1;
      if (div <= i) break;
      sum += n / i - 1;
    }
  }
  cout << sum << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'll' was not declared in this scope
   11 |       ll div = n / i - 1;
      |       ^~
a.cc:12:15: error: invalid operands of types '<unresolved overloaded function type>' and 'long long int' to binary 'operator<='
   12 |       if (div <= i) break;
      |           ~~~~^~~~
Language: C++

#include <iostream>
#include <string>
#define min(a,b) (a<b?a:b)
using namespace std;
typedef long long ll;
int main()
{
	ll n, ans = 0;
	cin >> n;
	for (ll i = 1; i <= floor(sqrt(n)); i++)
	{
		if ((n % i) == 0)
		{
			ll m = n / i - 1;
			if (i <= m)
				ans += m;
		}
	}
	cout << ans << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:35: error: 'sqrt' was not declared in this scope
   10 |         for (ll i = 1; i <= floor(sqrt(n)); i++)
      |                                   ^~~~
a.cc:10:29: error: 'floor' was not declared in this scope
   10 |         for (ll i = 1; i <= floor(sqrt(n)); i++)
      |                             ^~~~~
Language: Java

import java.util.Scanner;

public class ProblemD {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long ans = 0;
		for(long i=1;i*i<n;i++) {
			if(n%i==0) ans += n/i - 1;
		}
		System.out.println(ans);
		in.close();
	}

}


Compiler output:
Main.java:3: error: class ProblemD is public, should be declared in a file named ProblemD.java
public class ProblemD {
       ^
1 error
Language: C


#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <numeric>
#include <bitset>
using namespace std;
#define lint long long
#define ll long long
#define pq priority_queue
long long INF = 1e10;
#define pii pair<long long,long long>
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
/******************************define*********************************/

/*****************************functions********************************/

/****************************main function*****************************/
int main(void) {
	ll N; cin >> N;
	ll ans = 0;
	for (ll n = 1; n <= sqrt(N); n++) {
		if (N %n == 0) {
			if (n != 1) {
				if (N / (n - 1) == N % (n - 1)) ans += n - 1;
			}
			if (N*n / (N - n) == N % (N / n - 1)) ans += N / n - 1;
		}
	}

	cout << ans << endl;
	return 0;
}

Compiler output:
main.c:2:10: fatal error: iostream: No such file or directory
    2 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include<string>
#include<bits/stdc++.h>
using namespace std;
string findSum(string str1, string str2) 
{ 
    if (str1.length() > str2.length()) 
        swap(str1, str2); 
   
    string str = ""; 
    int n1 = str1.length(), n2 = str2.length(); 
    int diff = n2 - n1; 
    int carry = 0; 
    for (int i=n1-1; i>=0; i--) 
    { 
        int sum = ((str1[i]-'0') + 
                   (str2[i+diff]-'0') + 
                   carry); 
        str.push_back(sum%10 + '0'); 
        carry = sum/10; 
    }  
    for (int i=n2-n1-1; i>=0; i--) 
    { 
        int sum = ((str2[i]-'0')+carry); 
        str.push_back(sum%10 + '0'); 
        carry = sum/10; 
    }     if (carry) 
        str.push_back(carry+'0'); 
  reverse(str.begin(), str.end()); 
  
    return str; 
} 
int main()
{
   unsigned long long int n,k,i,j,sum=0,count=0,temp1,temp2;
   cin>>n;string temp_sum="0",ans="0";
   for(i=1;i<n/2;i++)
   {  temp_sum=ans;
       if((n/i)==(n%i))
       {   
           //string str1 = to_string(sum);
           string str2 = to_string(i);
           ans=findSum(str2,temp_sum);
           //sum=stoi(ans);
           
           
       }
       i=n-1;
      // cout<<i<<" ";
           str2 = to_string(i);
           ans=findSum(str2,temp_sum);
       //temp1 = stoi(str1);
         //  temp2 = stoi(str1);
           
   }
   
      cout<<ans<<endl;
   
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:12: error: 'str2' was not declared in this scope
   50 |            str2 = to_string(i);
      |            ^~~~
Language: C++

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

int main(){
  long long int N,ans=0,;
  cin>>N;
  for(long long int i=1; i*(i+1)<N; ++i){
    if(N%i==0) ans+=N/i-1;
  }
  cout<<ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:25: error: expected unqualified-id before ';' token
    5 |   long long int N,ans=0,;
      |                         ^
Language: C

#include <stdio.h>
#include <math.h>

int main(void)
{
	long long int n,m;
	
	long long int sum = 0;
	
	long long int temp = n - 1;
	
	scanf("%lld",&n);
	
	for(m = 1;m* m < n;m++){
		if(n / m == n % m){
			sum = sum + m;
		}
	}
		

	if(n / temp = n % temp){
		sum = sum + temp;
	}
	
	printf("%lld\n",sum);
	
	return 0;
	
}	

Compiler output:
main.c: In function 'main':
main.c:21:21: error: lvalue required as left operand of assignment
   21 |         if(n / temp = n % temp){
      |                     ^
Language: C

#include <stdio.h>
#include <math.h>

int main(void)
{
	long long int n,m;
	
	long long int sum = 0;
	
	scanf("%lld",&n);
	
	for(m = 1;m* m < n;m++){
		if(n % m == 0){
			long long temp = n/m;
			if(temp - 1 > k){
				sum = sum + m - 1;
			}
		}
	}
	
	printf("%lld\n",sum);
	
	return 0;
	
}
	
	
	
	

Compiler output:
main.c: In function 'main':
main.c:15:39: error: 'k' undeclared (first use in this function)
   15 |                         if(temp - 1 > k){
      |                                       ^
main.c:15:39: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <math.h>

int main(void)
{
	long long int n,m;
	
	// long long int sum = 0;
	
	scanf("%lld",&n);
	
	for(m = 1;m* m < n;m++){
		if(n % m == 0){
			long long temp = n/m;
			if(temp - 1 > k){
				sum = sum + m - 1;
		}
		
	}
	
	printf("%lld\n",sum);
	
	return 0;
	
}
	
	
	
	

Compiler output:
main.c: In function 'main':
main.c:15:39: error: 'k' undeclared (first use in this function)
   15 |                         if(temp - 1 > k){
      |                                       ^
main.c:15:39: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:33: error: 'sum' undeclared (first use in this function)
   16 |                                 sum = sum + m - 1;
      |                                 ^~~
main.c:25:1: error: expected declaration or statement at end of input
   25 | }
      | ^
Language: C

#include <stdio.h>

int
main(int argc, char *argv[])
{
  long long N, ans = 0, tem = 0, sqN;
  scanf("%lld", &N);

  for(long long i = 1; i < N; i++){
    if(temp <= N && N < i * i){
      sqN = i - 1;
      break;
    }
    temp = i * i;
  }

  for(long long i = 1; i <= sqN; i++){
    if(N % i == 0 && N / i - 1 > i) ans += N / i - 1;
  }

  

  printf("%lld\n", ans);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:8: error: 'temp' undeclared (first use in this function); did you mean 'tem'?
   10 |     if(temp <= N && N < i * i){
      |        ^~~~
      |        tem
main.c:10:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main(void){
	long int n,m,j,result;
  	cin >> n;
  	int start;
    result = 0;
  	if (n<=7){
        cout << n-1;
        return 0;
    }
  	for(k=2;k<=(int)(sqrt(n));k++){
    	if(n%k == 0){
        	result += n/k;
        }
    }
  	cout << result;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'k' was not declared in this scope
   13 |         for(k=2;k<=(int)(sqrt(n));k++){
      |             ^
Language: C++

#include<iostream>
#include <vector>
using namespace std;
int main(){
  long long N;
  cin >> N;
  long long qmax = sqrt(N);
  long long sum = 0LL;
  for (long long q = 0; q < qmax; q++){
    if(N%q==0){
      sum+= N / q - 1;
    }
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: 'sqrt' was not declared in this scope
    7 |   long long qmax = sqrt(N);
      |                    ^~~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>#
#define repp(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define repm(i,a,b) for(int i=(int)a;i>(int)b;--i)
using ll=long long;
static const int mod = 1e9;
using namespace std;

int main() {
	ll N;
	cin >> N;
	ll ans = 0;
	repp(i, 1, sqrt(N) + 1) {
		if ((N - i) % i == 0)ans += (N - i) / i;
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:6:14: warning: extra tokens at end of #include directive
    6 | #include<set>#
      |              ^
a.cc: In function 'int main()':
a.cc:17:20: error: 'sqrt' was not declared in this scope
   17 |         repp(i, 1, sqrt(N) + 1) {
      |                    ^~~~
a.cc:7:45: note: in definition of macro 'repp'
    7 | #define repp(i,a,b) for(int i=(int)a;i<(int)b;++i)
      |                                             ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main() {
	long long int N, ans = 0, divisor = 0;

	cin >> N;

	for (int i = 2;i <= sqrt(N); i++)
	{
		if (N % i == 0) {
			if (N / (i - 1) == N % (i - 1))ans += i - 1;
			if (N / (N / i - 1) == N % (N / i - 1))ans += N / i - 1;
		}
	}
	if (N == 2) { cout << 0; return 0; }
	cout << ans + N - 1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: 'sqrt' was not declared in this scope
   11 |         for (int i = 2;i <= sqrt(N); i++)
      |                             ^~~~
Language: C

#include <iostream>
#include <algorithm>
#include <cmath>

typedef long long ll;

using namespace std;

int main(void){
	ll n; cin >> n;
	ll ans = 0;
	
	for(ll i=1; i<sqrt(n); i++){
		ll p = n/i - 1;
		if(n % i != 0) continue;
		if(p <= i) continue;
		ans += p;
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <cstdio>
#include <string>
#include <stack>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <numeric>
using namespace std;

int main(){
    long long N;
    cin >> N;
    long long Sum = 0;

    for(long long i = 1 ; i*i <= N; i++){
        if(N % i != 0) continue;
        long long T = (N / i) - 1;
        if(i < T) Sum = Sum + T;
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
	long int n,m,i,j,result;
  	cin >> n;
  	i = 0;
  	if (n<=5){
        cout << n-1;
        return 0;
    }
  	long int count[n] = 0;
  	for(m=2;m<n/2;m++){
    	if(n/m==n%m){
        	count[i] = m;
            i += 1;
        }
    }
  	if(n!=1){
    	count[i] = n-1;
    }
  	result = 0;
  	for(j=0;j<=i;j++){
    	result += count[j];
    }
  	cout << result;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: array must be initialized with a brace-enclosed initializer
   11 |         long int count[n] = 0;
      |                             ^
Language: C++

#include <iostream>
using namespace std;
 
int main() {
   long long unsinged int N,b,c;
    cin >>N;
 int H[N];
  for(int i=1;i<N;i++){
     b=  N/i;
    c=N%i;
if(b==c){
H[i]=i;
}else{
    H[i]=0;
}
}
 
for(int j=1; j<N;j++){
H[j+1]+=H[j];
}
 
cout << H[N-1];
    }
 

Compiler output:
a.cc: In function 'int main()':
a.cc:5:23: error: expected initializer before 'int'
    5 |    long long unsinged int N,b,c;
      |                       ^~~
a.cc:6:11: error: 'N' was not declared in this scope
    6 |     cin >>N;
      |           ^
a.cc:9:6: error: 'b' was not declared in this scope
    9 |      b=  N/i;
      |      ^
a.cc:10:5: error: 'c' was not declared in this scope
   10 |     c=N%i;
      |     ^
a.cc:12:1: error: 'H' was not declared in this scope
   12 | H[i]=i;
      | ^
a.cc:14:5: error: 'H' was not declared in this scope
   14 |     H[i]=0;
      |     ^
a.cc:19:1: error: 'H' was not declared in this scope
   19 | H[j+1]+=H[j];
      | ^
a.cc:22:9: error: 'H' was not declared in this scope
   22 | cout << H[N-1];
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
	int n,m,i,j,result;
  	int count[n];
  	cin >> n;
  	for(m=1;m<n/2;m++){
    	if(n/m==n%m){
        	count[i] = m;
            i += 1;
        }
    }
  	count += 1;
  	for(j=0;j<=i;j++){
    	result += count[j];
    }
  	cout << result;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: incompatible types in assignment of 'int' to 'int [n]'
   13 |         count += 1;
      |         ~~~~~~^~~~
Language: C

#include <stdio.h>

int main(void)
{
	long long int n,m;
	
	long long int sum = 0;
	
	scanf("%lld",&n);
	
	for(m = 1;n < m m++){
		if(n / m == n % m){
			sum = sum + m;
		}
	}
	
	printf("%lld\n",sum);
	
	return 0;
	
}
	
	
	
	

Compiler output:
main.c: In function 'main':
main.c:11:24: error: expected ';' before 'm'
   11 |         for(m = 1;n < m m++){
      |                        ^~
      |                        ;
Language: C++

#include<iostream> main(){long n,x,i;std::cin>>n;for(i=1;i*i+i<n;i++)n%i?:x+=n/i-1;printf("%ld\n",x);}

Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include<iostream> main(){long n,x,i;std::cin>>n;for(i=1;i*i+i<n;i++)n%i?:x+=n/i-1;printf("%ld\n",x);}
      |                    ^~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>main(){long n,x,i;std::cin>>n;for(i=1;i*i+i<n;i++)n%i?:x+=n/i-1;printf("%ld\n",x);}

Compiler output:
a.cc:1:23: warning: extra tokens at end of #include directive
    1 | #include<iostream>main(){long n,x,i;std::cin>>n;for(i=1;i*i+i<n;i++)n%i?:x+=n/i-1;printf("%ld\n",x);}
      |                       ^
a.cc:1:9: fatal error: iostream>mai: No such file or directory
    1 | #include<iostream>main(){long n,x,i;std::cin>>n;for(i=1;i*i+i<n;i++)n%i?:x+=n/i-1;printf("%ld\n",x);}
      |         ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

main(){
	long n,x,i;
	std::cin>>n;
	for(i=1;i*i+i<n;i++) n%i?:x+=n/i-1;
	printf("%ld\n",x);
}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:14: error: 'cin' is not a member of 'std'
    3 |         std::cin>>n;
      |              ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | main(){
a.cc:5:9: error: 'printf' was not declared in this scope
    5 |         printf("%ld\n",x);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){
Language: C++

#include<iostream>
main(i){
	long n,x;
	std::cin>>n;
	for(i=1;i*i+i<n;i++) n%i?:x+=n/i-1;
	printf("%ld\n",x);
}

Compiler output:
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
    2 | main(i){
      |     ^
Language: C++

#include<iostream>
main(){
	long n,i,x;
	std::cin>>n;
	for(++i*i+i<=n;i++) n%i?:x+=n/i-1;
	puts("%ld\n",x);
}

Compiler output:
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:5:27: error: expected ';' before ')' token
    5 |         for(++i*i+i<=n;i++) n%i?:x+=n/i-1;
      |                           ^
      |                           ;
a.cc:6:13: error: too many arguments to function 'int puts(const char*)'
    6 |         puts("%ld\n",x);
      |         ~~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdio.h:714:12: note: declared here
  714 | extern int puts (const char *__s);
      |            ^~~~
Language: C++

#include<iostream>
main(){
	long long int n,i,ans=0;
	std::cin >> n;
	for(i=1;i*i<=n;i++) if(n%i==0&&i<n/i-1) ans+=n/i-1;
	std::cout << ans << endl;
}

Compiler output:
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |         std::cout << ans << endl;
      |                             ^~~~
      |                             std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<cstdio>
using namespace std;
main(){
	long long int n,i,ans=0;
	cin >> n;
	for(i=1;i*i<=n;i++) if(n%i==0&&i<n/i-1) ans+=n/i-1;
	cout << ans << endl;
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> n;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<cstdio>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:7:9: error: 'cout' was not declared in this scope
    7 |         cout << ans << endl;
      |         ^~~~
a.cc:7:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:24: error: 'endl' was not declared in this scope
    7 |         cout << ans << endl;
      |                        ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<cstdio>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main() {

  ll N;
  cin >> N;

  ll sum = 0;

  for(ll i=1; i*i<=N; i++){
    if(n%i != 0) continue;
    ll t = n/i;
    t--;
    if(i<t) sum+=t;
  }

  cout << sum;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: 'n' was not declared in this scope
   14 |     if(n%i != 0) continue;
      |        ^
a.cc:15:12: error: 'n' was not declared in this scope
   15 |     ll t = n/i;
      |            ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main() {

  ll N;
  cin >> N;

  ll sum = 0;

  for(ll i=1; i*i<=n; i++){
    if(n%i != 0) continue;
    ll t = n/i;
    t--;
    if(i<t) sum+=t;
  }

  cout << sum;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: 'n' was not declared in this scope
   13 |   for(ll i=1; i*i<=n; i++){
      |                    ^
Language: C++

#include<stdio.h>
#include<iostream>
#include<math.h>

using namespace std;

int main(){
  long long n;
  cin >> n;
  long long res = 0;
  
  long long i;
  long long bor = sqrt(n);
  long long f = 1;
  if(bor * bor == n){
    f = 0 
  }
  
  for(i=1; i*i <= bor + f; ++i){
    if(n%i == 0){
      res += n/i - 1;
    }
  }
  
  cout << res << "\n";

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: expected ';' before '}' token
   16 |     f = 0
      |          ^
      |          ;
   17 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long res = 0;
    long long n;
    cin>>n;
    if (n==2)
    {
        cout<<0;
        return 0;
    }
    long long rt = sqrt(n);
    int f=1;
    if (rt * rt == n)
    f = 0;
    for (int i = 1; i < rt + f; i++)
    {
        if (N % i == 0)
        {
            if (N / i - 1 > i)
            res += N / i - 1;
        }
    }
    cout << res;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'N' was not declared in this scope
   19 |         if (N % i == 0)
      |             ^
Language: C++

#include <iostream>
#include <math.h>
using namespace std;
int main(){
  double N; cin >> N;
  long long n = floor(sqrt(N));
  if (n*n == N && N != 1) {
    n--;
  }
  long long ans = 0;
  for(long long r = 1; r <= n; r++) {
    //long long ar = N - r;
    //if (ar % r == 0) {
    if(N == i*(i+1)) continue;
    if ((long long)N % r == 0) {
      //ans = ans + (ar / r);
      ans = ans + N / r - 1;
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'i' was not declared in this scope
   14 |     if(N == i*(i+1)) continue;
      |             ^
Language: C++

#include <iostream>
#include <math.h>
using namespace std;
int main(){
  double N; cin >> N;
  long long n = floor(sqrt(N));
  if (n*n == N && N != 1) {
    n--;
  }
  long long ans = 0;
  for(long long r = 1; r <= n; r++) {
    //long long ar = N - r;
    //if (ar % r == 0) {
    if (N % r == 0) {
      //ans = ans + (ar / r);
      ans = ans + N / r - 1;
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: invalid operands of types 'double' and 'long long int' to binary 'operator%'
   14 |     if (N % r == 0) {
      |         ~ ^ ~
      |         |   |
      |         |   long long int
      |         double
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {

  long int N;
  cin >> N;

  int sum = 0;
  for(long int i=1; i<N; i++){
    int d = N/i;
    int m = N%i;
    if(d==m) sum+=i;
  }

  cout << i;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: 'i' was not declared in this scope
   17 |   cout << i;
      |           ^
Language: C++

#include <iostream>
#include <math.h>
using namespace std;
int main(){
  long long N; cin >> N;
  long long n = floor(sqrt(N));
  if (n*n == N) {
    n--;
  }
  long long ans = 0;
  for(long long r = 1; r <= n; r++) {
    long long ar = N - r;
    if (ar % r == 0) {
      ans = ans + (ar / r);
    }
  }
  cout << ans << endl;
  return 0
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: expected ';' before '}' token
   18 |   return 0
      |           ^
      |           ;
   19 | }
      | ~
Language: C

#include <stdio.h>
#include <math.h>
int main()
{
    long long int n;
    long long int ans = 0, r;
    scanf("%lld", &n);
    r = (long long int)sqrt(n);
    for (int i = 1; i <= r; i++)
    {
        if (n % i == 0 && (n / i)*i == n
        {
            ans += n / i - 1;
        }
    }
    printf("%lld", ans);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:41: error: expected ')' before '{' token
   11 |         if (n % i == 0 && (n / i)*i == n
      |            ~                            ^
      |                                         )
   12 |         {
      |         ~                                
main.c:15:5: error: expected expression before '}' token
   15 |     }
      |     ^
Language: C++

from math import sqrt 

n = int(input())

x = int(sqrt(n))
if n == 2:
    print(0)
    exit()
ans = n-1
for i in range(2, x+1):
    y = dt = n//i
    while n//dt == n//y and n%y <= n//y:
        if n//y == n%y:
            ans += y
            break
        y -= 1
        if y == 1:
            break
        # print x,y,ans
print(ans)

Compiler output:
a.cc:19:11: error: invalid preprocessing directive #print
   19 |         # print x,y,ans
      |           ^~~~~
a.cc:1:1: error: 'from' does not name a type
    1 | from math import sqrt
      | ^~~~
Language: C++

def solve(N):
    s = 1
    e = int(pow(N, 0.5)) + 1
    ds = []
    for i in range(s, e):
        if N % i == 0:
            m = (N // i) - 1
            if m and N // m == N % m:
                ds.append(N // i)

    return sum([i - 1 for i in ds])

if __name__ == "__main__":
    N = int(input())
    print(solve(N))


Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def solve(N):
      | ^~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include <cmath>
#include <limits>
#include <utility>
#include <map>
#include <iomanip>


#define rep(p,q) for(int i = p;i < q;i++)
#define ll long long

using namespace std;

const int cons = 1e9 + 7;


//D
int main(void) {
	ll n;
	cin >> n;
	double upper = sqrt(n);// +0.5;
	ll ans = 0;
	vector<ll> div = vector<ll>();
	for(ll s = 1; s <= upper; s++) {
		if (n % s == 0) {
			div.push_back(s);
			div.push_back(n / s);
			
		}
	}
	for each(ll k in div) {
		if (k == 1) continue;
		else {
			ll m = k - 1;
			ll r = n % m;
			if (r == (n - r) / m) ans += m;
		}
	}

	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:13: error: expected '(' before 'each'
   34 |         for each(ll k in div) {
      |             ^~~~
      |             (
a.cc:13:12: error: expected primary-expression before 'long'
   13 | #define ll long long
      |            ^~~~
a.cc:34:18: note: in expansion of macro 'll'
   34 |         for each(ll k in div) {
      |                  ^~
a.cc:34:13: error: 'each' was not declared in this scope
   34 |         for each(ll k in div) {
      |             ^~~~
a.cc:44:1: error: expected primary-expression before '}' token
   44 | }
      | ^
a.cc:43:29: error: expected ')' before '}' token
   43 |         cout << ans << endl;
      |                             ^
      |                             )
   44 | }
      | ~                            
a.cc:34:13: note: to match this '('
   34 |         for each(ll k in div) {
      |             ^~~~
a.cc:44:1: error: expected primary-expression before '}' token
   44 | }
      | ^